Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello all,
I have a measure that calcualtes Prior year sales. When I am trying to calculate Rolling 4 week average of Prior Year sales its not working. I dont know what mistake I am doing.Please help.
Here are my calculations:
Prior Year Sales=
@Anonymous , Try these measure with week or week rank. For week rank refer my blog
1 year back rolling 4 =
var _week = maxx(allselected(Date), Date[WEEK])
var _year = maxx(allselected(Date), Date[Year])
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=_year-1 && 'Date'[Week] <= _week && && 'Date'[Week] >= _week -4))
or
1 year back rolling 4 =
var _week = maxx(allselected(Date), Date[WEEK RANK])
var _year = maxx(allselected(Date), Date[Year])
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=_year-1 && 'Date'[Week RANK] <= _week && && 'Date'[Week RANK] >= _week -4))
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |