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
bpowers2
Regular Visitor

Dynamic conditional formatting ranges by slicer selections

I'm trying to set different conditional formatting ranges based off slicer selections in a gauge. We have two different departments with separate goals for the same value field. I'd like to be able to show different ranges for red, yellow, green based off department selections from the slicer. I read another post and might be heading down the wrong path, but they had suggested setting up a color measure - but now if I go to format style by field value, that measure is grayed out and I can't use it . Am I on the right path, or is there a better way to accomplish this? I'm fairly new to PowerBI, but this is where I'm at currently at whith building the color measure

AHT Color =
SWITCH(SELECTEDVALUE('Combined Data'[Department]),
"UL", SWITCH(TRUE(), 'Combined Data'[AHT] >299, "#84D8BD"
, 'Combined Data'[AHT]<401, "#84D8BD"
, 'Combined Data'[AHT] >400, "#F0E199"
, 'Combined Data'[AHT] <501, "#F0E199"
, 'Combined Data'[AHT] >500, "#EFB5B9"),
SWITCH(SELECTEDVALUE('Combined Data'[Department]),
"LCSA", 'Combined Data'[AHT] >525, "#84D8BD"
, 'Combined Data'[AHT] <625, "#84D8BD"
, 'Combined Data'[AHT] >400, "#F0E199"
, 'Combined Data'[AHT] <525, "#F0E199"
, 'Combined Data'[AHT] >625, "#F0E199"
, 'Combined Data'[AHT] <701, "#F0E199"
, 'Combined Data'[AHT] >700, "#EFB5B9"
, 'Combined Data'[AHT] <3000, "#EFB5B9"
, 'Combined Data'[AHT] >0, "#EFB5B9"
, 'Combined Data'[AHT] <401, "#EFB5B9"))
2 REPLIES 2
technolog
Super User
Super User

@bpowers2 

You can fix it in 3 steps:

1. Set one color in the measure without any conditions

2. Set this measure for visualization
3. Set the right condition in the measure to calculate the color

 

technolog_0-1692740706337.png

 

technolog_1-1692740706326.png

 

p.s. Setting the measure type as "Text" has helped in the past, but that no longer works for me now

v-binbinyu-msft
Community Support
Community Support

Hi @bpowers2 ,

I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

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.