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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
clk245
New Member

How to convert Data type from Text to Number

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.

clk245_0-1722435266548.png

clk245_0-1722435369822.png

 

 

8 REPLIES 8
Anonymous
Not applicable

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

Ahmedx
Super User
Super User

create a new column and write the following formula
Number.From(
Text.Select([ON HAND QUANTITY],{"0".."9"}))

Screenshot_1.png

Tob_P
Helper V
Helper V

Do you have a sample of what's in that column at source?

clk245_0-1722439414154.png

 

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

Tob_P
Helper V
Helper V

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.

clk245_0-1722436636412.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors