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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

If function with a text column and a mixed column with both text and number

Hi Everyone,

I have two columns, column A = "Yes" and "No" values, all text
Column B = numbers (1,5,10,16,20 & "n/a" & "cohort error") thus column B contains both numbers and text and PowerBi classes it as a text column.

My issue comes when I want to run an If formula, so I am trying to do * IF(column A) = "No" && (Column B) < 5, "yes", "no". I get the error "Dax comparison operations do not support comparing values of type text with values of type integer.consider using the Value or Format function to convert one of the values.

I have tried using both the Value and Format function to no avail. If I use the Value function on column B - it tells me that my text values e.g. "n/a" cannot be converted to number etc.

I am not sure what to do as the text values in column B "n/a" etc have to be there as they are pulling from a lookup.

Thank you in advance

Regards,

P
1 ACCEPTED SOLUTION
Thim
Resolver V
Resolver V

You could use this Dax function to make a new column.

IFERROR(VALUE(Table2[Column B]);1000000)

 

This will change all text values and errors to 1.000.000. (Feel free to chose another number, but it does have the be a number)

 

Then use the new column as replacement for the column B in your formula.Yes & No.PNG

 

If you don't want a new column, you can type it all in one Formula.

IF(Table2[Column A]="No" && IFERROR(VALUE(Table2[Column B]);1000000)<5;"Yes";"No")

 

Hope this will help. 🙂

View solution in original post

2 REPLIES 2
Thim
Resolver V
Resolver V

You could use this Dax function to make a new column.

IFERROR(VALUE(Table2[Column B]);1000000)

 

This will change all text values and errors to 1.000.000. (Feel free to chose another number, but it does have the be a number)

 

Then use the new column as replacement for the column B in your formula.Yes & No.PNG

 

If you don't want a new column, you can type it all in one Formula.

IF(Table2[Column A]="No" && IFERROR(VALUE(Table2[Column B]);1000000)<5;"Yes";"No")

 

Hope this will help. 🙂

Anonymous
Not applicable

Thank you for your help 🤗🤗

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors