sql-bi / DaxDateTemplate

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

Shif particular bank holidays #68

Closed caroheymes closed 2 years ago

caroheymes commented 2 years ago

Hello Marco I need to add "special" days that are not banks holidays (Mother's Day, Grandmother's Day, ...).

Most of time these days fall on Sundays. The problem is when we have to deal with exceptions.

In France, Mother's Day is celebrated on the last Sunday of May { "FR", 6, 0, -7 ,1, 0, "Mothers Day", 0, 100, 0, 0 } Unless this day is the same as the Whit sunday then we have to shoft to the first sunday of June !!!

Have you any hint or solution ? Many thanks

marcosqlbi commented 2 years ago

You can avoid two holidays on the same day with the Conflict Priority parameter. However, once you have Whit Sunday on the last Sunday of May, the big issue is shifting Mother's Day to the following Sunday. The current system doesn't have a way to manage that - and I think that it's too complex to implement a system that can manage that logic in a flexible way. Probably it's better to add exceptions as single dates using FIrstYear and LastYear with the same year for the Mother's Day holidays that are in June.