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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX comparison operations do not support comparing values of type True/False with values of type Num

Hi, 

 

I'm trying to create a colum that will give me a RAG rating based on the planned and BAU figures. I have created a new column and done the following formula however it gives me the message above. 

 

RAG Rating = if(('Targets and Tolerances'[PLANNED]>'Targets and Tolerances'[BAU]) &&('Targets and Tolerances'[ACTUAL]>'Targets and Tolerances'[PLANNED]),"green",if(('Targets and Tolerances'[PLANNED]>'Targets and Tolerances'[BAU]) &&('Targets and Tolerances'[BAU]<'Targets and Tolerances'[ACTUAL]<'Targets and Tolerances'[PLANNED]),"amber",if(('Targets and Tolerances'[PLANNED]>'Targets and Tolerances'[BAU]) && ('Targets and Tolerances'[ACTUAL]<'Targets and Tolerances'[BAU]),"red",if(('Targets and Tolerances'[PLANNED]<'Targets and Tolerances'[BAU]) && ('Targets and Tolerances'[ACTUAL]<'Targets and Tolerances'[PLANNED]),"green",if(('Targets and Tolerances'[PLANNED]<'Targets and Tolerances'[BAU]) && ('Targets and Tolerances'[BAU]>'Targets and Tolerances'[ACTUAL]>'Targets and Tolerances'[PLANNED]),"amber",if(('Targets and Tolerances'[PLANNED]<'Targets and Tolerances'[BAU]) && ('Targets and Tolerances'[ACTUAL]>'Targets and Tolerances'[BAU]),"red","ERROR"))))))

 

joshuap_0-1600334967801.png

 

I have checked the data type of all columns and they are all decimal number so don't think it is that. Any help is much appreciated.

 

Josh

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Is this a measure column. Seem like a column. unless [PLANNED], [BAU] etc are measures

 

Looking at code I do not see the error.  Better you use Switch True

Switch( True(),

//Condition , //result,

//Condition , //result,

//else

)

 

To find this error, you have check each condition separately

Anonymous
Not applicable

Hi, thanks for the reply, not entirely sure what you mean though.

 

I have tried the formula with one if and it works but as soon as I add a second if then it comes up with the error message. 

 

These are all columns and it is a column that i created.

 

Thanks

@Anonymous , Can you share a sample pbix after removing sensitive data.

Or check if condition one by for error.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors