Forum Discussion
amirabedhiafi
5 years agoImpactful Individual
get the last N weeks data
I have the following model : I want to calculate using DAX the Last N Weeks Covid cases excluding the current week. The numbers should change dynamically with the What-if-Parameters sel...
- 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
Deepanshi_Ranka
3 years agoRegular Visitor