Forum Discussion
SaraVM
6 years agoRegular Visitor
Compare Same Week Last Year Per Category
Hi all, I've been trying to work out how to compare values of visits per market for the same week last year but nothing seems to work. 1. I have a Calendar date table on DAX 2. It's linked...
- 6 years ago
Hi SaraVM ,
Please try this:
Total Visits VOL = SUM ( IntMarkets[Total Visits] )Total Visits LY = VAR ThisYear = MAX ( IntMarkets[Year] ) VAR LastYear = ThisYear - 1 RETURN CALCULATE ( [Total Visits VOL], IntMarkets[Year] = LastYear )For more details, please check the attached PBIX file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SaraVM
6 years agoRegular Visitor
Hi Icey,
I'm affraid that doesn't work. I'm getting annual values instead of weekly values. See screenshot below. Any other ideas?
Icey
Community Support
6 years agoHi SaraVM ,
Please try this:
Total Visits VOL = SUM ( IntMarkets[Total Visits] )Total Visits LY =
VAR ThisYear =
MAX ( IntMarkets[Year] )
VAR LastYear = ThisYear - 1
RETURN
CALCULATE ( [Total Visits VOL], IntMarkets[Year] = LastYear )
For more details, please check the attached PBIX file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.