Forum Discussion
pawelj795
6 years agoPost Prodigy
Difference between most recent value and last value
Hi, I'm currently calculating the difference in Facebook likes between the last update and the most recent update. Our updates vary, sometimes after 7 days, sometimes after 10 days, sometimes after...
- 6 years ago
pawelj795 - Sorry, I always mess up dates in non-US form.
Measure = VAR __MaxDate = MAX('Table'[Update Date]) VAR __2ndDate = MAXX(FILTER('Table',[Update Date]<>__MaxDate),[Update Date]) VAR __2ndValue = SUMX(FILTER('Table',[Update Date] = __2ndDate),[Likes]) VAR __MaxValue = SUMX(FILTER('Table',[Update Date] = __MaxDate),[Likes]) RETURN __MaxValue - __2ndValue
Greg_Deckler
6 years agoCommunity Champion
pawelj795 - Sorry, I always mess up dates in non-US form.
Measure =
VAR __MaxDate = MAX('Table'[Update Date])
VAR __2ndDate = MAXX(FILTER('Table',[Update Date]<>__MaxDate),[Update Date])
VAR __2ndValue = SUMX(FILTER('Table',[Update Date] = __2ndDate),[Likes])
VAR __MaxValue = SUMX(FILTER('Table',[Update Date] = __MaxDate),[Likes])
RETURN
__MaxValue - __2ndValuepawelj795
6 years agoPost Prodigy
Greg_Deckler
Thanks that works perfectly! I was exactly looking for that.
By the way, I have the same issue with US date format 😉
- Greg_Deckler6 years agoCommunity Championpawelj795 - Sweet!