Forum Discussion
Difference in previous week
- 4 years ago
Hello there NewbieJono ! Imagining you are adding up the values for a column the Dax would be as follows:
Total_value = CALCULATE( SUM(Table[Column]), DATEADD(Date_Table[Date_Column], -7, DAY) )Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
this is working thank you, how could i expand this to show % change ?
Hello there NewbieJono ! You can do it like so:
% Change =
var _current = SUM(Table[Column])
var _previous =
CALCULATE( SUM( Table[Column] ),
DATEADD( Date_Table[Date_column], -7, DAY)
)
var _diff = _current - _previous
RETURN
DIVIDE(_diff, _previous) And then format the value as a "%" in the "Format" ribbon!
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes