Forum Discussion
Roym
4 years agoHelper IV
Adjust session result based on previous session
I have a table in PBI that shows a long list of assessment results, both the test and review, and based on that I need to calculate the New_Result. As example I have the below table. For session 1 an...
Greg_Deckler
4 years agoCommunity Champion
Roym So, seems like you need to essentially look at previous row when looking to calculate a value for the current row. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous