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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Gaddam
Frequent Visitor

Measure for Colour coding

Hello All, 

 

I having problem with the colour changing, i am switch measure but is not working, always showing the values in  red colour

TestPerc_CC = SWITCH(True(),[Test_Percentage]>50,"green",[Test_Percentage]<50&&[Test_Percentage]>20,"orange", "red")
 
Thanks in advance
Gaddam
1 ACCEPTED SOLUTION

Try with decimals from 0 to 1 instead in your switch cases and see if it works.

TestPerc_CC = SWITCH(True(),[Test_Percentage]>0.50,"green",[Test_Percentage]<0.50&&[Test_Percentage]>0.20,"orange", "red")

 

View solution in original post

3 REPLIES 3
TomasAndersson
Solution Sage
Solution Sage

The measure as you wrote it works fine for me when I test it. Is your Test_Percentage a value between 0 and 100? Could perhaps be that Test_Percentage is a percentage between 0 and 1.00?

Thanks for the time..yes the values are between 100% to 0%. For 100 it's showing red and 0 as well..

Try with decimals from 0 to 1 instead in your switch cases and see if it works.

TestPerc_CC = SWITCH(True(),[Test_Percentage]>0.50,"green",[Test_Percentage]<0.50&&[Test_Percentage]>0.20,"orange", "red")

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.