Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi All,
When I filter the number of previous weeks in Query, Power BI takes one week as Sunday to Saturday. Is there a way for me to set or change it so that Power BI reads one week as Monday to Sunday? Thanks in advance for the help
Best Regards
Hi @7ea8ea ,
You can create a column by WEEKNUM:
WEEKNUM = WEEKNUM('Table'[Date],2)
Week begins on Monday. Weekdays are numbered 1 through 7.
And you can use measure like below to filter the number of previous weeks.
Measure = CALCULATE(SUM('Table'[column]),FILTER('Table','Table'[WEEKNUM] = WEEKNUM(Today())- selectednumber)))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@7ea8ea , Create a date table with Week columns like these
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)
New measures
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))
refer 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-La...