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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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

Anonymous
Not applicable

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

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors