Forum Discussion
phanimusunuri9
8 years agoFrequent Visitor
Week over Week Comparison
Hi All, I am trying to compare "Monday Last week's Sales" with "Monday this week's Sales". To be precise, if today is 'Monday' i want to compare it with last 'Monday', if 'Tuesday then last week ...
- 8 years ago
You should have Year, Week Number and Weekday columns in your table. Or you can generate with calculated column.
WeekNumber = WEEKNUM(Table[Date],2)
WeekDay = WEEKDAY(Table[Date],2)
Then you can create a measure like:
Difference = SUM ( Table[Sales] ) - CALCULATE ( SUM ( Table[Sales] ), FILTER ( ALL ( Table ), Table[Year] = MAX ( Table[Year] ) && Table[WeekNumber] = MAX ( Table[WeekNumber] ) - 1 && Table[WeekDay] = MAX ( Table[WeekDay] ) ) )Regards,
mase_53
4 years agoNew Member
Hi Ashish_Mathur phanimusunuri9 Anonymous jcabeza is there a way to use this solution - when my Year, Week Number and Weekday columns live in another table (dim_dates) but have an active relationship with the date in the table containing sales? Would appreciate your help!
Ashish_Mathur
4 years agoSuper User
Hi,
Share some data, describe the question and show the expected result.