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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
SK78
Frequent Visitor

Conditional formatting for a text based field using Measure

Referenced this youtube video: https://www.youtube.com/watch?v=Y8xmJgVjdZs

 

I created a measure in the measures table to perform conditional formatting on a field that has text values

SK78_0-1596983283493.png

 

SK78_1-1596983283509.png

 

In the conditional formatting for section

 

SK78_2-1596983315764.png

 

Can’t seem to find out why only conditional formatting is working for some fields that have the same Value: This is occuring for throughout the dashboard for even other values mentioned in the DAX measure

 

SK78_4-1596983546373.png

 

 

I am trying to decipher with no luck. Any pointers will be greatly appreciated

 

 

Thanks

SK78

1 ACCEPTED SOLUTION

Check your data strings for leading or trailing spaces or other fancy invisible characters that might return a negative comparison result.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

You can specify colors directly and also simplify the Switch statement.

 

switch(ChaRMstatus,"Created","Green","In Development","#2F4F6F","white")

 

There are lookup tables available on the interwebs with the accepted colo(u)r names.

 

Then do the conditional formatting based on field value rather than rules.

 

Note: Not sure if naming a variable the same as the measure it is in is a good idea.

 

 

SK78
Frequent Visitor

I tried the suggestion you shared but still running into error..

 

Any thoughts or pointer - can't seem to figure out why some entries of the same value get highlighted but others don't. 

SK78_3-1597016473131.png

 

Check your data strings for leading or trailing spaces or other fancy invisible characters that might return a negative comparison result.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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