Power BI Change Data Type of a Column

In this Microsoft Power BI Tutorial, We will discuss why we use this Change Data type of a column in Power BI, how to change the data type (from one data type to another data type) of a column in Power BI.

Also, we will see what are the different ways to change the data type of a column in Power BI with a simple example.

If you are new to Microsoft Power BI, then using this below article, you can learn the Power BI from the beginning: Getting started with Microsoft Power BI Tool

Why we use Power BI Change Data type of a column?

Suppose there is a table in the Power BI Desktop and that table has many columns. In this case, Most of the time, Power BI will automatically detect the data type of column. But the maximum time the data type of column is getting wrong data type.

Read Export Power BI report to excel or PDF.

Let’s take an example. If your Power BI column is having dates, values, amounts as the text data type (Power BI automatically detects all these column data types as text) but it should not be always only text data type. In this case, you can use Power BI change data types of a column option.

To change the data type of a column in Power BI, you can follow the below processes.

Types of Power BI Data Type

There is a total of nine different data types in Power BI. Those Data types are present in below:

  • Decimal Number
  • Fixed decimal number
  • Whole Number
  • Date/Time
  • Date
  • Time
  • Text
  • True/False
  • Binary

Different ways to change the Data type of a Column in Power BI

There are three different ways to change the Data type of a column in Power BI such as:

  • Change the Data type of a column by clicking on the specific column itself
  • Change the Data type of a column from the ribbon
  • Change the Data type of a column by right-clicking on the specific column

Power bi change data type

Here I will show you how we can change the Data type of a specific column by using different three ways as:

Change Power BI Data type of a column by clicking on the specific column itself

This is the first approach to change the Data type of a column in Power BI. In this example, I have used the Excel table named Job Application Form. You can follow this article to learn how to create a table by using the Power BI Enter Data option.

At first, To change the specific column data type in Power BI, click on the Edit Queries option from the top which is present under the Home tab as shown below.

In the below screen, you can see my table as Job Application Form which is having nine columns.

change data type of a column in power bi
change data type of a column in power bi

Once you will click on the Edit Queries option, it will open a new window known as Power Query Editor.

Check out a tutorial on Power BI buttons.

In the below screenshot, you can see the Average Percentage, Salary like some of the columns are loaded as the Text data type. (Automatically detected by the Power BI)

  how to change data type of a column in power bi
how to change data type of a column in power bi

First, Select your column in which you want to change the Data type and then click on the left corner of the column header (represents as ABC text) as the below screenshot.

As per my requirement, I want to change the Salary column data type as the Whole Number.

Power bi change data type column
Power bi change data type column

When you will click on the (ABC text) of the specific column, it will open a drop-down list where you have to select the data type as per your requirement.

Read a tutorial on Power BI Workbooks.

As I wanted to change the Salary column as the Whole Number, So I have selected the data type as the Whole Number from the drop-down list.

Power bi change data type of a column
Power bi change data type of a column

Now a pop-up window will come where it will ask you to either you like to replace the existing conversation or preserve the existing conversion and add the new conversion as a separate step.

As per my requirement, I have clicked on the Replace current button as shown below.

change data type of column in power bi
change data type of column in power bi

Now in the below screenshot, you can see the Salary column is showing as 123 whole number data type instead of ABC text data type.

how to change data type of column in power bi
how to change data type of column in power bi

Change Power BI Data type of a column from ribbon

This is the second approach to change the Data type of a column in Power BI. In this way, you can use the Data Type option which is present in the ribbon under the Home tab as shown below.

Select your column in which you want to change the Data type and then go to the Home tab -> click on the Data Type drop-down.

As per my requirement, I want to change the data type of the Average Percentage column as the Fixed Decimal Number data type.

power query data types
power query data types

Just click on the Data type and select the Power BI Data type as the Fixed decimal number as shown below.

power bi convert text to number
power bi convert text to number

After clicking on the Fixed decimal number data type, a pop-up window will appear. Let’s click on Add new step. This means the change column type will add as a new step under the applied steps.

change data type of new column in power bi
change data type of new column in power bi

Now in the below screenshot, you can see a new step as the Average Percentage column is showing as a $ Fixed decimal number data type instead of ABC text data type.

change data type of a new column in power bi
change data type of a new column in power bi

Change Power BI Data type of a column by right-clicking on the specific column

This is the third approach to change the Data type of a column in Power BI. Select your column in which you want to change the Data type and right-click on that column. Once you will right-click on it, the context menu will appear.

As per my requirement, I wanted to change the Phone Number column data type as Whole Number data type. That’s, why I have right-clicked on the column. Then I have selected Change Type -> Whole Number as like the below screenshot.

how to change data type of new column in power bi
how to change data type of new column in power bi

Now in the below screenshot, you can see the PhoneNumber column is showing as 123 whole number data type instead of ABC text data type directly.

how to change data type of a new column in power bi
how to change data type of a new column in power bi

After changing all the Power BI Data types of all columns, you must ensure to click on the Close and Apply button which is present at the top of the page under the Home Tab.

Until and unless you will not hit this button, then it will not affect the Power BI Desktop page.

power bi change data type of calculated column
power bi change data type of calculated column

Now go to the Power BI Desktop page, you can see the table has specified with the suitable data types columns (whatever you have changed the data types recently) as you can view in the below screenshot.

how to change data type of calculated column in power bi
how to change data type of calculated column in power bi

Also, you may like the below Power BI articles:

Hence in this Microsoft Power BI Tutorial, We discussed why we use this Change Data type of a column in Power BI, how we can change the data type (from one data type to another data type) of a column in Power BI.

Also, we saw what are the different ways to change the data type of a column in Power BI with a simple example.

>