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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.