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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Mous007
Helper IV
Helper IV

Conditional formatting issue

Hi all,

 

I have generated the below table with two metrics.

The Quality KPI switch = 

quality KPI switch = SWITCH(TRUE(),
[Quality KPI] < -0.1 , "G" ,
[Quality KPI] <= 0 && [Quality KPI] >= -0.1 , "A" ,
[Quality KPI] < 1 , "R" )
 
Mous007_0-1606309990682.png
 
I would like to apply  conditional formatting with three different colors to the quality KPI column using the quality KPI figures
I want to apply the following rules to my formatting
 
If Quality KPI is between 0 and - 10% --> "A" and "Color1"
If quality KPI is more than - 10% --> "G" and " Color2"
If quality KPI is more than 1% or any positiive value --> "R" and "color2".
 
I tried to add the colors into the switch function and also tried the conditional formatting but did not manage to get the expected results
 
Can anyone please help me achieve this or at least guide me on how i can get it done ?
 
Thanks in advance
 
 
 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Mous007 , a color measure like given below can used in conditional formatting with field value option

 

quality KPI color = SWITCH(TRUE(),
[Quality KPI] < -0.1 , "Green" ,
[Quality KPI] <= 0 && [Quality KPI] >= -0.1 , "Yellow" ,
[Quality KPI] < 1 , "Red" )

 

 

refer for steps

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

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Mous007 

May be this way: 

Quality KPI switch = 
SWITCH(
    TRUE(),
    [Quality KPI] < -0.1 , "Green" ,
    [Quality KPI] <= 0 && [Quality KPI] >= -0.1 , "Amber" ,
    [Quality KPI] > 1 , "Red" 
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Mous007 , a color measure like given below can used in conditional formatting with field value option

 

quality KPI color = SWITCH(TRUE(),
[Quality KPI] < -0.1 , "Green" ,
[Quality KPI] <= 0 && [Quality KPI] >= -0.1 , "Yellow" ,
[Quality KPI] < 1 , "Red" )

 

 

refer for steps

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

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.