Forum Discussion
Anonymous
7 years agoNot applicable
Conditional Formatting Matrix Table by Row by Cell
Our customer asked for a daily scorecard view of a dozen targets. Each row represents a unique target. The screenshot shows the target and the conditional formatting applied. The ID and description...
Anonymous
7 years agoNot applicable
HI Anonymous ,
AFAIK, current power bi not contains row/column index. If you want to conditional formatting row/cell color, you need to add condition to check current row contents and compare with if statement conditions.
BTW, I also try to transform your formula to make it dynamic based on current item and result color string to do color formatting.
_Format =
VAR selected =
SELECTEDVALUE ( 'BH_SCORECARD'[SC_GOAL_ID] )
VAR _multi =
IF (
selected IN { 1, 4 },
5000,
IF (
selected IN { 2, 3 },
100,
IF (
selected IN { 6, 7, 9, 10, 11 },
20,
IF ( selected IN { 8, 11 }, 10, IF ( selected = 5, 25 ) )
)
)
)
VAR _offset =
IF ( selected IN { 2, 3 }, 100, 0 )
RETURN
IF (
SUM ( 'BH_SCORECARD'[SC_ACTUAL] ) < 1 * _multi + _offset,
"Green",
IF ( SUM ( 'BH_SCORECARD'[SC_ACTUAL] ) < 2 * _multi + _offset, "Yellow", "Red" )
)
Conditional formatting in tables
Regards,
Xiaoxin Sheng