Forum Discussion
Session result calculation based (including previous result)
Roym , I think it should be session in first Var
Column =
var _previosid=MAXX(filter('Table','Table'[session]=EARLIER('Table'[session])&& 'Table'[ID]< EARLIER('Table'[ID])),'Table'[ID])
var _review=CALCULATE(MAX('Table'[Review]),FILTER('Table','Table'[ID]=_previosid))
return
SWITCH(TRUE(),'Table'[Test]="Effective" && 'Table'[Review]="Effective","Effective",
'Table'[Test]="Effective" && 'Table'[Review]="Ineffective","Ineffective",
'Table'[Test]="Effective" && 'Table'[Review]="Open",_review)
amitchandak Nicee, this (almost) works! Not sure why, but for the first new session (2) it keeps the column empty, any idea how to fix that? The rest is working perfectly now!! Thanks
- Anonymous4 years agoNot applicable
HI Roym,
The expression is calculated based on the current session group, so the highlight row can't find out previous records with the same session group to calculate.
For this scenario, it means you need to add a condition to check if the current row is the first row, then you can use the current id to find out the previous id and use it as a condition to calculate.
Regards,
Xiaoxin Sheng
- Roym4 years agoHelper IV
Anonymous Thanks, this makes sense. Can you give any additional guidance on how to implement this? I'm not sure how, thanks