Forum Discussion
madison13g
2 years agoRegular Visitor
Conditional Filtering - But doesn't re-colour columns when filtered
I want to colour the background of a cell in my table based on a rank (gradient where: 1= green, middle value = yellow, highest value = red). However, there are 5 different groups of different sizes ...
- Anonymous2 years ago
Hi, madison13g
Thanks for PhilipTreacy reply. Based on your description, you can refer to Measure below.
Steps:
1. Choose the visual, turn to Cell elements and open Backgroud color.2. Use Field value and choose the measure.
Measure:Group color = VAR _group1 = CALCULATE ( MAX ( 'Table'[value] ), 'Table'[Group] = "Group1", ALL ( 'Table' ) ) VAR _group2 = CALCULATE ( MAX ( 'Table'[value] ), 'Table'[Group] = "Group2", ALL ( 'Table' ) ) VAR _group3 = CALCULATE ( MAX ( 'Table'[value] ), 'Table'[Group] = "Group3", ALL ( 'Table' ) ) VAR _group = SELECTEDVALUE ( 'Table'[Group] ) VAR _value = SELECTEDVALUE ( 'Table'[value] ) RETURN // _group1 SWITCH ( _group, "Group1", IF ( _value = 1, "Green", IF ( _value > 1 && _value < _group1, "Yellow", IF ( _value = _group1, "Red" ) ) ), "Group2", IF ( _value = 1, "Green", IF ( _value = _group2, "Red", IF ( _value > 1 && _value < _group2, "Yellow" ) ) ), "Group3", IF ( _value = 1, "Green", IF ( _value = _group3, "Red", IF ( _value > 1 && _value < _group3, "Yellow" ) ) ) )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
PhilipTreacy
2 years agoSuper User