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
BenBrubacher
Frequent Visitor

Conditional Formatting with Multiple Criteria

I am trying to do conditional formatting with multiple criteria. 

 

Each client has a different service levels to meet.  For example, Client A, B, C need to be coloured green if the service level measure is greater or equal to 80% and coloured red if below, Client D would be green if service level measure is greater or equal to 75% and red if below, and so forth.  The standard conditional formatting doesn’t work as far as I can tell given there are different threshold based on client.

 

In this chart here, how would I make client D red, knowing the 74.07% is below the 75% service level requirement.

 

svl.png

Note sure if it helps, but this is the measure I used to calculate the service level.

Service Level =

var SL = DIVIDE(sumx (RCCalls, RCCalls[Answered_InSVL] ), sumx (RCCalls,  if( RCCalls[ClientName] = "ClientD", RCCalls[Offered]-RCCalls[Short_Abandoned], RCCalls[Answered]) ))

return SL

 

In addition to the Service Level measure, I’ve tried creating a new measure and a new column with switch statements, and nested if statements but I don’t even come close, so apologies for lack of code for the actual measure to aid with the conditional formatting. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BenBrubacher , You can create a color measure based on client and SL% and return a color.

Check example


color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"blue",
// Add more conditions
"red"
)

 

Then use that in coditional formatting using "Field Value" Option

 

refer these links 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

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@BenBrubacher , You can create a color measure based on client and SL% and return a color.

Check example


color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"blue",
// Add more conditions
"red"
)

 

Then use that in coditional formatting using "Field Value" Option

 

refer these links 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

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Thank you so much, worked perfectly!

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.