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
SharePoint Online tutorial contents:
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.
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)
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.
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.
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.
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.
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.
Just click on the Data type and select the Power BI Data type as the Fixed decimal number as shown below.
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.
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 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.
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.
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.
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.
Also, you may like the below Power BI articles:
- Power BI Visualizations
- Power BI Custom Visuals
- Add Title, Image, and Video to Power BI Dashboard
- Create a Power BI Dashboard and Add Reports to Power BI Dashboard
- PowerBI Report Filter using Slicer Visualization
- Power BI: Create a various report from SharePoint Online list
- Access to the resource is forbidden error in Power BI
- Create a Power BI report from Excel using Power BI Desktop
- Add Web Content to Power BI Dashboard
- [Video Tutorial] Create Power BI Dashboard step by step tutorial
- Microsoft Power BI Error: This content isn’t available
- Power BI On-premises Data Gateway
- Power BI Query Group Tutorial
- How to Split Columns in Power BI
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.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”