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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors