Forum Discussion
Anonymous
5 years agoNot applicable
Error Convert Text to Number
Hi, I tried to convert one column, which has been automatically exported as text, to decimal number, but I got below error. Do you know how I can fix this?
- 5 years ago
@ehsanbh , check for space.
Create a new column with Text.Trim and convert it to decimal and see if it works. It means it's a problem to have white space.
if necessary, see how to handle the error in the power query
https://www.youtube.com/watch?v=OE6DPmKqN7s
https://www.youtube.com/watch?v=9-Lag0VOiTs - 5 years ago@ehsanbh You are welcome. I'm glad it worked.
PS, you can mark more than one answer as a solution, since Amit and I responded around the same idea with similar suggestions - great minds think the same. 🙂
AllisonKennedy
5 years agoCommunity Champion
I'm guessing there's either a space after the number or a hidden formatting like html code that is preventing it from being a pure number. Try doing a clean and trim, then change data type to number.
What's the data source?
What's the data source?
Anonymous
5 years agoNot applicable
@AllisonKennedy Trim worked perfectly! Thanks a lot. These are electricity data I am reading from a CSV file.
- AllisonKennedy5 years agoCommunity Champion@ehsanbh You are welcome. I'm glad it worked.
PS, you can mark more than one answer as a solution, since Amit and I responded around the same idea with similar suggestions - great minds think the same. 🙂