Power BI Change Data Type of a Column

Introduction

Mostly the Power BI Desktop tool automatically detects the datatype of a column based on its value. Sometime it detects wrong datatype because Power BI automatically detects all these column data types as text (mostly) or as some other datatype formats. Say for an example, the Number’s may be converted to Text datatype or text may be converted to datetime. It is converting because to give efficient storage and calculations and better visualizations.

In this case, we can use Power BI change data types of a column option. But its easy fixable one. In this article, we will discuss how to fix the Datatype of a Column or how to change datatype of a column in Power BI. There are many options to do it, but in this article, we will follow the standard and easy one.

Change Data Type of a Column

Before changing the datatype of a column, lets see what are the datatypes supported by Power BI. There is a total of nine different datatypes in Power BI as,

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

Now lets changes the datatype by using Transfer Data option from the ribbon tool which will open the Query editor window.

Fig.1 Query Editor in Power BI to perform data transformation

From the above example, if we look into the Salary column, its datatype is as Decimal. If we go to the Transform menu, and see the Data Type, it shows the current datatype of the selected column.

Fig. 2 Example column with its datatype

If we want to change the datatype of the selected column, from the Transform datatype, just click the down arrow and choose the accurate datatype for that column.

Fig. 3 List of Datatypes in Power BI

In our case, lets convert the decimal datatype to Whole Number datatype.

Fig. 4 Datatype changed to Whole Number from Decimal

Conclusion

In this simple article, we discussed how to change the datatype of a column in Power BI using Query Window. I hope you all found this article useful. Please share your feedbacks in the comment section. Lets discuss more concepts on Power BI in our upcoming articles.

One thought on “Power BI Change Data Type of a Column

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Built with WordPress.com.

Up ↑

%d bloggers like this: