Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Become a Certified Power BI Data Analyst! Prepare for Exam PL-300 with expert-led live sessions. Get registered!

Reply
VivekDI
New Member

How to change Text to Decimal Number datatype without altering the values

I have a Sales table with a unit price column (Decimal number values). When I import this CSV file in Power BI Desktop and change the data type from ABC Text to Decimal number the unit price column’s original value is changed i.e. original price 3.2 is changed into 32. When I change it back to ABC Text, the correct value (i.e. 3.2) is displayed. But I cannot store numbers in text format right. I want to convert the value 32 into 3.2. 

I have attached the image for reference. The left side of the image displays the unit price with the right values but with the wrong data type (ABC). (On Right side of the image) But when I change the datatype to a Decimal number the right values i.e. 3.2 are getting altered to 32. Can someone please tell me how to fix this?. Thank you. 

 

                                      0001.jpg

1 ACCEPTED SOLUTION
jeroendekk
Resolver V
Resolver V

Hi @VivekDI 

Your system probably has comma's as decimal seporator instead of periods.

3 ways to solve this when dealing with US style data.


1. you could use the replace values option on the transform tab in Power Query to replace periods with comma's before changing the data type.
2. When changing the datatype choose the locale option and then say its a decimal but with united states formatting. (This option is very helpfull when importing dates with mm/dd/yyyy format into a system with diferent settings.
3. Change the settings of your machine. But this will effect al lot of other programs as well.

Best regards,
Jeroen Dekker

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

THAT SOLUTION OF CHANGING PERIODS TO COMMAS WORKED FOR ME.

NOW I HAVE THE PROBLEM OF NEGATIVE VALUES. CONVERTING THEM FROM TEXT TO DECIMAL BRINGS ME AN ERROR MESSAGE.

Marcelo17146_0-1706881438313.png

jeroendekk
Resolver V
Resolver V

Hi @VivekDI 

Your system probably has comma's as decimal seporator instead of periods.

3 ways to solve this when dealing with US style data.


1. you could use the replace values option on the transform tab in Power Query to replace periods with comma's before changing the data type.
2. When changing the datatype choose the locale option and then say its a decimal but with united states formatting. (This option is very helpfull when importing dates with mm/dd/yyyy format into a system with diferent settings.
3. Change the settings of your machine. But this will effect al lot of other programs as well.

Best regards,
Jeroen Dekker

Hi, @jeroendekk as per your suggestion I used the locale option while changing the datatype and it worked. Thanks a lot for your help. 👍

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.