Forum Discussion
Conditional formatting of Matrix cells based on previous row value
- Anonymous2 years ago
Hi davidz106 ,
Based on my testing, please try the following methods:
1.Create the index column.
2.Create the new measure to highlight the values.
Difference = VAR CurrentValue = SELECTEDVALUE('Table'[Median of Speed]) VAR _Index = SELECTEDVALUE('Table'[Index]) VAR PreviousValue = CALCULATE(MAX('Table'[Median of Speed]), FILTER(ALL('Table'), 'Table'[Index] = _Index - 1)) RETURN IF(CurrentValue <> PreviousValue, "yellow", "white")3.Select the Median of Speed column and choose conditional formatting > Background color.
4.Select Field value and choose the measure.
5.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 2 years ago
Got it.
Difference =VAR CurrentValue = SELECTEDVALUE('Table'[Median of Speed])VAR _Index = SELECTEDVALUE('Table'[Index])VAR PreviousValue = CALCULATE(MAX('Table'[Median of Speed]), FILTER(ALL('Table'), 'Table'[Index] = _Index - 1))RETURNIF(_Index = 1,"white",IF(CurrentValue <> PreviousValue, "yellow", "white"))
Hi davidz106 ,
Based on my testing, please try the following methods:
1.Create the index column.
2.Create the new measure to highlight the values.
Difference =
VAR CurrentValue = SELECTEDVALUE('Table'[Median of Speed])
VAR _Index = SELECTEDVALUE('Table'[Index])
VAR PreviousValue = CALCULATE(MAX('Table'[Median of Speed]), FILTER(ALL('Table'), 'Table'[Index] = _Index - 1))
RETURN
IF(CurrentValue <> PreviousValue, "yellow", "white")
3.Select the Median of Speed column and choose conditional formatting > Background color.
4.Select Field value and choose the measure.
5.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- davidz1062 years ago
Helper III
Very well. But is there a way the first value (100 inside AP1-1.1) does not get highlighted because technically from my point of view it does not have a "previous row".
- davidz1062 years ago
Helper III
Got it.
Difference =VAR CurrentValue = SELECTEDVALUE('Table'[Median of Speed])VAR _Index = SELECTEDVALUE('Table'[Index])VAR PreviousValue = CALCULATE(MAX('Table'[Median of Speed]), FILTER(ALL('Table'), 'Table'[Index] = _Index - 1))RETURNIF(_Index = 1,"white",IF(CurrentValue <> PreviousValue, "yellow", "white"))