cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J0hNN13
New Member

Changing a column from Any data type to decimal

Hi, community.

 

I am new to this community and Power BI Desktop but have built a basic dashboard successfully through the help of some online resources.  I am also unfamiliar with DAX.

I have imported Excel data into Power BI, but I noticed that by default, Power BI puts certain values in columns with Data Type as "Any" by default.

 

In the first screenshot below, is an example of my data in such a column.  One value is a whole number, the other is a decimal number.  The null value is not a problem for me and thus, not applicable in this issue.  In the second screenshot, I always receive an Error on the decimal value, when changing the data type to decimal, or Whole Number.  I need both numbers in the same column, rounded to one decimal. Can you please guide me on how I can achieve this?

 

Thank you in advance

 

PBi_1.jpgPBi_2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4 REPLIES 4
FarhanAhmed
Super User
Super User

Can you please click on the error to see the details and also share with us

Also make sure that there are no "Leading/Trailing" spaces in your numbers causing your data to become Text. therefore try to Clean and Trim the data before changing the data type of it by right click on the column and perform such operations.

 

FarhanAhmed_0-1655986153298.png

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Hi @FarhanAhmed,

 

Thank you for your response.

 

On your first request, see the error details below when I try to change the data type to Decimal Number:

Error returned when changing data type from "Any" to "Decimal Number'"Error returned when changing data type from "Any" to "Decimal Number'"

 

 

I am not familiar with "Leading/Trailing" spaces, but I did try your suggested fix.  After applying both "Trim" and "Clean" options, the data type changed to "Text" by default. See below.

Data Type = "Text" after trim and cleanData Type = "Text" after trim and clean

 

When I then change the data type to "Decimal Number", I receive the same error as above.  See below:

 

Error returned after Decimal TypeError returned after Decimal Type

 

What did I miss?

I think you need to check regional setting of your machine ..







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Okay, what should it be if not my locale?

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors