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
Anonymous
Not applicable

if statement with text and number error

Trying to convert a mixed column of letters and numbers to all numbers.  It is giving me an error when it actually is a number in the column.  

 

Where you see "Error" in the "Unit Per ASSY Fix", I need the number value in "UNIT PER ASSY"

 

Capture.PNG

1 ACCEPTED SOLUTION

That error still seems odd and I'd like to figure it out just to learn, but if all you want to do is grab the number and otherwise count it as 0, you could bypass the whole conditional column and try Add Custom Column instead. Use the formula below:

 

=try Number.From([UNIT PER ASSY]) otherwise 0

View solution in original post

6 REPLIES 6
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Your decimal is with . or with ,

 

Maybe change this in Conditional colum 0,0 instead 0.0




Lima - Peru
Anonymous
Not applicable

I started by just putting in 0 but I changed it to 0.0 to see if that would fix the problem. 

 

So in short, I would like it to be 0 if the column is non-numeric and the number if a number.

That error still seems odd and I'd like to figure it out just to learn, but if all you want to do is grab the number and otherwise count it as 0, you could bypass the whole conditional column and try Add Custom Column instead. Use the formula below:

 

=try Number.From([UNIT PER ASSY]) otherwise 0
Anonymous
Not applicable

That worked perfectly!  Thank you

KGrice
Memorable Member
Memorable Member

I tried to recreate and don't get the error. Can you click in the white space of the one the cells, next to the word Error? That should give an idea of what's going on in a message at the bottom.

Anonymous
Not applicable

Here is the error

Capture.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.