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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Caiz
Frequent Visitor

Conditional Formatting Logic in Matrix based on Variance

I'm trying to do conditional formatting with a traffic light column in my matrix.

This is what the traffic light is based on:

0-5% variance = GREEN

6-10% variance = ORANGE

11%+ variance =RED

 

I'd read on other forums because I was working with negative percentage variances so have been using:

95-100% -> -0.05 to 1

90-94% -> -0.16 to 0.1

89-0< -> -0.11

 

However, there is an error in one of my outputs -0.06 where it should be ORANGE instead of black. Everything else is correct.

 

Rules.PNGrules 2.PNG

 

How do I fix this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Caiz ,

 

If value is less than -0.06 means value <-0.06 not value <= -0.06. You can try to set if value is less than -0.055.

edited orange.PNG

14.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Caiz ,

 

I made a number axis chart. As you can see in the figure, -0.06 is not within the condition range, so it is black.

18.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous , I have changed the rule for Orange:

edited orange.PNG

However, it still remains black.

Anonymous
Not applicable

Hi @Caiz ,

 

If value is less than -0.06 means value <-0.06 not value <= -0.06. You can try to set if value is less than -0.055.

edited orange.PNG

14.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Caiz , Might need data /pbix to check that.

 

You can create a color measure like this.

 

Switch(True(),
[% variance] >-0.005 , "green",
[% variance] >-0.01 , "orange",
[% variance] >-1 , "red",
"blue"
)

 

and use that in coditional formatting, after using "Field Value" option

 

refer

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors