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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
purnima13
Helper I
Helper I

Can't convert text to decimal

I have put the following values in a google doc:
The column is formatted into number in the google doc

 

latitude
7.4064
7.6904
7.6904
5.3627
7.6904

 

I am however unable to transform it into a decimal number in power BI.
It says- Error: We couldn't convert to Number.

Please help me fix this.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @purnima13,

 

Could you try to replace the "." for a "," and see if that helps ?

 

regards,

L.Meijdam

View solution in original post

11 REPLIES 11
Johannf78
Advocate I
Advocate I

Left-click on the heading of the column you want to convert from text to decimal. Click on the icon indicating the data type. Then instead of clicking on "1.2 Decimal value" click on the last item "Using Locale..."  From the Data Type drop-down list select "Decimal Number". From the Locale drop-down list select  "English (United States)". Only this locle works, the outers does not.

FGilbert
New Member

This has been solved a long time ago, but in case someone stumbles on this post looking for a solution, an alternative solution that I would prefer in such a case is making use of the optional Culture field of the TansformColumnTypes function. By adding "en-US" after de list of fields to modify, the "." will be parsed as the decimal separator. Example:

=Table.TransformColumnTypes(#"PreviousStep", {"MyTextColumn", type number}, "en-US")

Sujith_S
Frequent Visitor

Hi,
The process is very simple.. Go to the Query Editor and right click on the column and change the Type to the desired type.

We cannot convert the type from a whole number to decimal from a data view. enable the query editor and change it.

All the best!

Thank you Sujith.This solution worked for me

vanessafvg
Super User
Super User

@purnima13 the problem is going to be some other text field possibly in your column are you sure its all decimals?  i dont see why there would be a problem converting,  otherwise there might be spaces trying doing a format  clean and trim in power query





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg: The only values in the file is what you see.
I have tried cleaning and trimming and it did not work

Anonymous
Not applicable

Hi @purnima13,

 

Could you try to replace the "." for a "," and see if that helps ?

 

regards,

L.Meijdam

Hi @Anonymous

It worked for me, thanks a lot!

Best regards,

Mihaly

@Anonymous: I can't believe this actually worked. Thank you so much.
But I still don't understand why, do you know?

Anonymous
Not applicable

Hi @purnima13,

 

I have not a single idea why a "," works and a "." does'nt, but it happened to me before and this solved it for me. That is how I knew.

 

Anyway glad it worked for you 🙂

 

Regards,

L.Meijdam

Anonymous
Not applicable

I had the same problem and i converted "." to "," and it worked . Eventually i found that it was due to my regional settings  that "," was treated as the decimal separator . Once i changed the regional settings "." was working . Hope this helps 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors