Forum Discussion
Anonymous
5 years agoNot applicable
Total difference from previous date
Hi all, I have 2 columns, one with values and the other with dates. The dates are non continous , for e.g. 10/10/2019, 12/10/2019, 20/10/2019 etc I need to be able to get the difference betwe...
- 5 years ago
Hi Anonymous,
You can try measure like the following
Delta From Previous = var prev_date = CALCULATE(MAX('WeeklyOutstanding'[Week]), FILTER(all('WeeklyOutstanding'), 'WeeklyOutstanding'[Week] < SELECTEDVALUE('WeeklyOutstanding'[Week]))) return sum('WeeklyOutstanding'[amount]) - CALCULATE(SUM('WeeklyOutstanding'[amount]), FILTER(ALL('WeeklyOutstanding'), 'WeeklyOutstanding'[Week] = prev_date))Hope that Helps
Richard
Anonymous
5 years agoNot applicable
This worked great! Thank you!
The only issue now is that somehow it only works with the full data, whenever I use filters its gives the wrong amounts. Do you know why?
richbenmintz
5 years agoResident Rockstar
It is removing the filter context with
all('WeeklyOutstanding'[Week])
, you may need to change that be just
ALL('WeeklyOutstanding')