Forum Discussion
Week number shifted one week
Hi.
In my visual, I have a checkbox seleciton to define which weeks I want to get values from. The week selection seems to be shifted by +1.
For example, if I select "week 40", I get data from "week 39".
Any ideas?
Hi EriSte
Try this, create the masure below
Measure = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),'Table'[Week]= MIN('Table'[Week])-1))Here is a similar solution for your reference, link
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandak
Super User
EriSte , seem like you need last week
You need column like these in date or week table
new columns
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW formatmeasures like
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))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 - v-xiaotang
Community Support
Hi EriSte
Try this, create the masure below
Measure = CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),'Table'[Week]= MIN('Table'[Week])-1))Here is a similar solution for your reference, link
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.