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
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
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.