Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to change this column to a data type number. The values are numbers, I've trimmed the values but whenever I try to convert to number, it still throws an error.
Hi @clk245 ,
There doesn't seem to be a problem with the code provided.
If the data source is .xls file, try saving it as .xlsx and try again.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
create a new column and write the following formula
Number.From(
Text.Select([ON HAND QUANTITY],{"0".."9"}))
Do you have a sample of what's in that column at source?
I made sure that the column also was in the number format as well.
You're doing everything right. I just threw in the same data to a .pbix and it auto-detected and converted the columns to number. The only thing I can lastly suggest is removing the Trimmed Text and Replaced Value applied steps
Hard to see what might be the issue but the error message is pointing to the zero being the issue (could be everything to be honest, it's probably just flagging that as it's the first in the list).
I take it you've tried to convert to number without trimming first - not sure why you would need to do this. Otherwise generally this error would flag up when there's perhaps a bit of text in the column or something like a #N/A
Yep, I've tried converting without trimming, I've tried replacing values and trying to find any erronious values or text.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |