How to Change Data Type in Power BI?

Last week, when I created a Power BI report for the Finance team, I received the data from SQL. After loading it into Power BI, I noticed that some fields had the wrong data type. For example, a few columns were loaded as text, but they should have been numbers.

To change the data type, Power BI gives us three options: using the Column Tools tab in both Report View and Table View, using DAX, or using the Power Query Editor.

In this tutorial, I will explain the different data types available in Power BI, how to change the data type using the Column Tools tab, and how to change the data type using DAX. I have also already created a separate blog post where I explain how to change the data type using the Power Query Editor in Power BI.

Power BI Data Types

In Power BI, different data types are available to help users manage and understand their data correctly. Here are the common data types:

  • Decimal Number: This feature allows for numbers with fractional parts, and the number of decimal places is not fixed.
  • Fixed Decimal Number: This feature allows a number with two decimal places.
  • Whole Number: This feature allows only whole numbers without any decimal or fractional parts.
  • Percentage: This feature allows the use of values to store as percentages.
  • Date/Time: This feature allows storing both date and time information.
  • Date: This feature allows the storage of only date information.
  • Time: This feature allows the storage of only time information.
  • Date/Time/Timezone: This feature allows you to store the date and time along with timezone information.
  • Duration: This feature allows you to store the time span, such as 2 days 1 hour.
  • Text: This feature allows storing words, sentences, or text information.
  • True/False: This feature allows you to store boolean values, True or False.
  • Binary: This feature allows the storage of binary data.

These are the data types available in Power BI to help you prepare and structure your data correctly before using it in reports and visualizations. Power BI.

Change the Data Type in Power BI

Now, I will tell you how to change the data type in Power BI.

Here, we have a SharePoint list (Financial Sample) that contains below columns with various data types:

ColumnsData Types
ProductSingle line of text
CountrySingle line of text
Units SoldCurrency
SalesNumber
ProfitCurrency
Gross SalesNumber
Sales PriceCurrency
SegmentSingle line of text

Follow the steps below to change the data types.

  1. Open Power BI Desktop and load the data using the Get data option. Then, you see data in the Data pane.
power bi change type
  1. Then go to the table view on the left side.
Change Data Type in Power BI
  1. Select the column that you want to change. In my case, Units Sold is a Fixed Decimal Number, but I want to use Whole Numbers. You can see this in the Table tools tab.
change data type power bi
  1. From the drop-down, click Whole Number to change the Units Sold column data type to Whole Number.
Power BI Change Data Type
  1. A message appears asking whether you want to continue. Click yes to apply the change.
how to change data type in power bi using dax
  1. After that, the Unit Sold column data types change to Whole Number.
power bi data types

This way, you can change the data type of a column in Power BI.

Change Data Type in Power BI using DAX

Now, I will show you how to change the data type in Power BI using DAX.

  1. Now, go to the Table view.
change date format power bi dax

Here, you can see that the Sales column is not in currency format, so I want to change it to currency format. To do this, follow the steps below.

  1. Under the Home tab, click the New column.
dax change data type
  1. In the formula bar, click the expression below. Then click Commit.
New Sales = CONVERT('Financial Sample'[Sales],CURRENCY)

Where:

  • New Sales: Name of the Measure
  • CONVERT: DAX Function
  • Financial Sample: Name of the Table
  • Sales: Name of the Column
  • CURRENCY: Data Type
how to change data type in power bi using dax
  1. After changing the currency format, you’ll notice a new column added to our dataset with the currency format applied.
Change column data type in Power BI

You can change the data type in Power BI using DAX using the steps above.

Change Data Type to Integer in Power BI DAX

Now, let’s learn how to convert a currency format to an integer. Follow the steps below to do this.

  1. Under the Home tab, click the New column.
Power BI Data Types
  1. In the formula bar, click the expression below. Then click Commit.
New Units Sold = CONVERT('Financial Sample'[Units Sold],INTEGER)

Where:

  • New Units Sold: Name of the Measure
  • CONVERT: DAX Function
  • Financial Sample: Name of the Table
  • Units Sold: Name of the Column
  • INTEGER: Data Type
How to Change Data Type From Power BI
  1. After changing the integer format, you’ll notice a new column added to our dataset with the Integer format applied.
How to replace data type of a column in power bi DAX

This way, we can change the currency format to an integer format in Power BI using DAX.

Conclusion

In this tutorial, you learned what data types are available in Power BI. I also showed you how to change the data type in Power BI in two ways: using the Column Tools tab and DAX.

You may also like:

Leave a Comment

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App