Forum Discussion
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.
- Anonymous9 years ago
11 Replies
- AnonymousNot applicable
- mihalytothNew Member
Hi Anonymous
It worked for me, thanks a lot!
Best regards,
Mihaly
- purnima13
Helper I
Anonymous: I can't believe this actually worked. Thank you so much.
But I still don't understand why, do you know?- AnonymousNot 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
- Sujith_SFrequent 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!- preethisaldanhaFrequent Visitor
Thank you Sujith.This solution worked for me
- vanessafvg
Community Champion
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
- purnima13
Helper I
vanessafvg: The only values in the file is what you see.
I have tried cleaning and trimming and it did not work
- FGilbertNew 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")
- Johannf78
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.