cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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? 

1.JPG2.JPG3.JPG 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Error Convert text to number

@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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Super User IV
Super User IV

Re: Error Convert text to number

@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. 🙂

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

4 REPLIES 4
Highlighted
Super User IV
Super User IV

Re: Error Convert Text to Number

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?

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

Highlighted
Super User IX
Super User IX

Re: Error Convert text to number

@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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper II
Helper II

Re: Error Convert text to number

@AllisonKennedy Trim worked perfectly! Thanks a lot. These are electricity data I am reading from a CSV file.

Highlighted
Super User IV
Super User IV

Re: Error Convert text to number

@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. 🙂

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors