Forum Discussion
Difference between previous week data
cham - You can use a variable in your "previous week" measure:
Measure 2 =
var prev_week_num = WEEKNUM(max('Sheet1'[Date]),1)-1
calculate(
sum('Sheet1'[Total]),
'Table'[Column] = prev_week_num
)Hope this helps,
Nathan
- cham7 years agoPost Patron
Hi Anonymous
Do I need to only use this measure to calculate the difference between previous week data?
Regards,
Cham
- Anonymous7 years agoNot applicable
cham - No, I was substituting the measure 2 with the one I mentioned.
Also, parry2k gave good advice about adding a date table to your model. That table can include WeekNumber and it would be best to also have a "RelativeWeek" or "WeekKey" which is what you would use to calculate the previous week. If you need assistance with that, let us know.
The solution I provided will not actually work when the weeks go across years.
- cham7 years agoPost Patron
Hi Anonymous
Yes I alredy create a new calender in my sheet and i make a relationship between calender table and my sheet date. I want to know what is wrong with my measures which i show in earlier. Can you please explain it to me?