Forum Discussion
mrclay823
1 year agoNew Member
Rolling 52 weeks.
Hi all, I want to create this visual in PBI for our [sales] measure (pretend that w.2 is last week and for 52 weeks. So, one line to show the sales rolling 52 weeks and one to show the same p...
bhanu_gautam
Super User
1 year agomrclay823 , Create Measures for Rolling 52 Weeks Sales:
Rolling52WeeksSales =
CALCULATE(
SUM(Sales[SalesAmount]),
DATESINPERIOD(
DateTable[Date],
MAX(DateTable[Date]),
-52,
WEEK
)
)
Create Measures for the Same Period Last Year:
Rolling52WeeksSalesLastYear =
CALCULATE(
[Rolling52WeeksSales],
SAMEPERIODLASTYEAR(DateTable[Date])
)
Add the DateTable[Date] to the axis.
Add the Rolling52WeeksSales measure to the values.
Add the Rolling52WeeksSalesLastYear measure to the values.
mrclay823
1 year agoNew Member
Hi,
- techies1 year ago
Super User
Hi there mrclay823
Have you tried this?
Rolling 52 Weeks Sales =CALCULATE([sales],FILTER(ALLSELECTED('date'),YEAR('date'[Date]) = YEAR(MAX('date'[Date])) &&'date'[Weeknum] <= WEEKNUM(MAX('date'[Date])) &&'date'[Weeknum] > WEEKNUM(MAX('date'[Date])) - 52),ALLEXCEPT('date', 'date'[Year]))