Forum Discussion
Akbera1
1 year agoHelper I
Condition formatting
Hey All, i want condition formatting on more then 1 condition. if type A is above 10 then or below 10% is red and type B is above 5% green and below is red. like: Materials Type V...
- 1 year ago
Hi Akbera1
Can you please try this ?
Create a measure and use conditional formatting.ValueColor =SWITCH(TRUE(),MAX('Table'[Type]) = "A" && MAX('Table'[Values]) < 0.10, "#FF0000", -- RedMAX('Table'[Type]) = "A" && MAX('Table'[Values]) >= 0.10, "#00FF00", -- GreenMAX('Table'[Type]) = "B" && MAX('Table'[Values]) < 0.05, "#FF0000", -- RedMAX('Table'[Type]) = "B" && MAX('Table'[Values]) >= 0.05, "#00FF00", -- GreenBLANK())
If this answers your questions, kindly accept it as a solution and give kudos.
alish_b
1 year agoSuper User
Hey Akbera1 ,
You could also use a measure for this. Similar concept as a calculated column but this will be generated on the fly and then apply the conditional formatting on the 'Values' column based on Field value where you pass the measure as the field value (Please refer to the screenshot).
ConditionalFormat =
VAR TypeSelection = SELECTEDVALUE('SampleTable'[Type])
VAR ValueSelection = SUM('SampleTable'[Values])
RETURN
SWITCH(TRUE(),
TypeSelection = "A" && ValueSelection >= 0.10 , "Green",
TypeSelection = "A" && ValueSelection < 0.10, "Red",
TypeSelection = "B" && ValueSelection >= 0.05, "Green",
TypeSelection = "A" && ValueSelection < 0.05, "Red"
)
Hope it helps!