Forum Discussion

bpowers2's avatar
bpowers2
Regular Visitor
3 years ago

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

  • Anonymous's avatar
    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

  • 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

     

     

     

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