Forum Discussion
Anonymous
3 years agoNot applicable
Help with Previous Value
Greetings, I'm trying to create a column where if the value of the column [VALOR DO LITRO ORIGINAL] = null, the cell brings the previous value of [VALOR DO LITRO ORIGINAL], as in the image exampl...
Greg_Deckler
3 years agoCommunity Champion
Anonymous 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