Forum Discussion
Anonymous
4 years agoNot applicable
Week Over Week Change in Date
Hello. I have a data set that is primarily activities and dates. Each week we update the data, but I do not replace the old data. Instead, I use the imported file name to generate a work week num...
Greg_Deckler
4 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. Can also use a VAR instead of EARLIER. Your use case is different but the pattern is the same essentially.
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