The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |