sql-bi / DaxDateTemplate

Power BI template to create a Date table in DAX
MIT License
265 stars 76 forks source link

Endofweek doesn't have values for the last week of Year #46

Open wangfeng9981 opened 3 years ago

wangfeng9981 commented 3 years ago

Marco, When I implement DAX Date Template v.1.14 Calendar into my project, I found if I set up the one year (2020) calendar, the last Week 12/27/2020 - 1/2/2021 for the FW EndOfWeek is 1/2/2021, but that value is empty (or null); see the screenshot

If I want to get the year 2020 end week Week 12/27/2020 - 1/2/2021 for the FW EndOfWeek value, I need to set up two years (2020 & 2021) calendar. Is this the only way to get the ending week value if this cross to next year?

Thank you very much!

marcosqlbi commented 2 years ago

Can you specify which parameters did you use? If you evaluate the WeeklyFiscalPeriods (replace Result with WeeklyFiscalPeriods at the end) you can see the fiscal periods evaluated - for FW2020 the last day is 12/26/2020 and 12/27/2020 is the first week of FW2021. By changing the parameter you might obtain a different result, but I'm not sure about your requirements.