Forum Discussion
Anonymous
2 years agoNot applicable
Offset dates for week number
Credit to Enterprise DNA for setting me on this path (Get Power BI Previous Week Values Using DAX & Power Query (enterprisedna.co))
I can't seem to find the formula to properly offset the week numbers. I've tried looking up the Microsoft Offset function explanation but I am incredibly lost.
What I'm trying to achieve is the current week shows as 0, the previous week shows at -1 and next week would be one.
I have tried the following but I know it will trip me up when the year changes:
LW = IF(dim_date[Year]=YEAR(today()),if(dim_date[Week Number]=WEEKNUM(today())-1,TRUE(),FALSE())
Thanks in advance.
1 Reply
- Greg_DecklerCommunity Champion
Anonymous I know that Melissa de Korte's date table includes a week offset. Otherwise, you could try Sequential: Sequential - Microsoft Fabric Community. Might have to modify it a bit for your specific requirements.