Forum Discussion
IuteJV
2 years agoFrequent Visitor
Conditional formatting based on previous row value
Hello I have a problem I have not been able to crack. I have an audit table, where I need to display different data points and highlight those data points (different columns) that have been change...
- 2 years ago
Here's a general idea how you can do this with OFFSET
The sorting was done to check that the formula works, and can be changed back to the row number (or whatever else you are planning to sort this by.
Age Change = var v = sum('Table'[Measure1-age]) var vp = CALCULATE(sum('Table'[Measure1-age]),OFFSET(-1,ALLSELECTED('Table'), ORDERBY([Row Number (example purpose only)]), PARTITIONBY('Table'[Country],'Table'[Product]), MATCHBY('Table'[Row Number (example purpose only)]))) return if(COALESCE(vp,v)<>v,"yellow")
lbendlin
2 years agoSuper User
Here's a general idea how you can do this with OFFSET
The sorting was done to check that the formula works, and can be changed back to the row number (or whatever else you are planning to sort this by.
Age Change =
var v = sum('Table'[Measure1-age])
var vp = CALCULATE(sum('Table'[Measure1-age]),OFFSET(-1,ALLSELECTED('Table'),
ORDERBY([Row Number (example purpose only)]),
PARTITIONBY('Table'[Country],'Table'[Product]),
MATCHBY('Table'[Row Number (example purpose only)])))
return if(COALESCE(vp,v)<>v,"yellow")