Forum Discussion
get the last N weeks data
- 5 years ago
amirabedhiafi , Refer my post on WOW, You can create Week Rank in You date table and Use that.
Last 2 weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-2 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
The above two can come from what if measure
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
amirabedhiafi , Refer my post on WOW, You can create Week Rank in You date table and Use that.
Last 2 weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-2 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
The above two can come from what if measure
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
- amirabedhiafi5 years ago
Impactful Individual
How can I link Last 2 weeks to the parameter?
- amirabedhiafi5 years ago
Impactful Individual
amitchandak I modified it to :
Last2weeks = CALCULATE(SUM('COVID Data'[COVID Cases]), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-WeekRank[WeekRank Value] && 'Date'[Week Rank]<=max('Date'[Week Rank])))after creating the Week Rank Calculated Column in the Dimension Date.But I can't see the value : - whatisdata964 years ago
Helper I
How do you get week rank once you have WeekEND Date established in your date table?