Forum Discussion
cham
7 years agoPost Patron
Difference between previous week
Hi,
Here is my data set,
| Date | Spend | Pay |
| 22-07-19 | 589.32 | 425.22 |
| 24-07-19 | 3652.85 | 1833.72 |
| 21-07-19 | 3659.5 | 2744.64 |
| 24-07-19 | 2312.59 | 1726.67 |
| 24-07-19 | 519.59 | 347.25 |
| 24-07-19 | 21178.48 | 17955.15 |
| 24-07-19 | 3016.45 | 3734.56 |
| 22-07-19 | 2130.75 | 1562.65 |
| 31-07-19 | 107.52 | 68.16 |
| 31-07-19 | 65 | 45.5 |
| 31-07-19 | 1430.74 | 1078.24 |
| 31-07-19 | 108.3 | 15534.32 |
| 01-08-19 | 1011.23 | 10910.91 |
I created a mesaure using this data set as below,
%Amount = (SUM('Sheet1'[Spend]) - SUM('Sheet1'[Total Pay])) / SUM('Sheet1'[Spend])
I want to get the diffrence between previous week %Amoun with this week. How can i do that?Hope this will help you because i provide the data set.
10 Replies
- AnonymousNot applicable
Hi cham ,
Check if this helps.
https://community.powerbi.com/t5/Desktop/Variance-over-week-DAX/m-p/479504#M223174
Cheers
CheenuSing
- AnonymousNot applicable
Hey cham
You can use a calculated column:
% = CALCULATE(((SUM(T20[Spend]) - SUM(T20[Pay])) / SUM(T20[Spend])), FILTER(T20, T20[WEEKNUM] = EARLIER(T20[WEEKNUM])))
Where WEEKNUM is another column:
WEEKNUM = WEEKNUM(T20[Date ])
I did NOT QA this solution.
Thanks!
A- chamPost Patron
Hi Anonymous ,
What is this T20 you mentioned in your measure? Can you please explain it to me?
- AnonymousNot applicable