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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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

Hi All ,

 

Q1. I've tried but I cant figure out how to solve this error: "DAX comparison operations do not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values" 

 

The error comes when I try to do this formula:

NewColumn =
IF ([OutOfDate] > 9, "Red" ,
IF ([OutOfDate] <= 9 && [OutOfDate]>=5 = "Amber", "Green"
))
Im trying to create a column that displays Amber/Red/Green dependping on how high the number is. "NewColumn" is calculating this from 2 other measures I created if thats useful (Last entry and date difference between that days and now) 
 
Wierdly, I have another dashbord with this exact table and it works just fine, so Im confused about the error in this dashbord. Ive checked to make sure everything is the same but no luck!
 
Q2. In the second dashboard, I have a column that calculates the "NewColumn" just fine, and the outputs are red amber green depending on the location. I want to display this in a bar chart so that theres a bar for 'red', bar for 'green' etc . So far using the bar chart feature, it displays the total of unique value, 3 in this case. Is there a way I can seperate them and display red, green and amber sepereately? 
feel free to suggest a better way to do that if statement 
1 REPLY 1
HotChilli
Super User
Super User

It's not a good idea to create a column based on a measure.

Use other columns to get what you want (that way you are in control of the context used in the new column).

Alternatively, create a measure.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors