Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
OK, full disclosure, was raised Catholic so I am familiar with Christian holidays like Easter, etc. However, it bugged me that the US Holidays submission was a bit Christian centric. Not a puposeful intent to be exclusionary, just not very familiar with the holidays and observances of every other religion. But, it bugged me enough that I decided to learn about the Hebrew calendar and holidays. Stitched together information from these websites:
Lots of different calculations included in the PBIX but they all pretty much center around the calculation for Rosh Hashanah:
Rosh Hashanah =
VAR __Year = MAX('Years'[Year])
VAR __G = MOD(__Year,19) + 1
VAR __NFraction =
( TRUNC(__Year/100) - TRUNC(__Year/400) - 2) +
765433/492480 *
MOD(12*__G,19) +
MOD(__Year,4)/4 -
(313*__Year + 89081)/98496
VAR __Day1 = TRUNC(__NFraction)
VAR __Day = IF(__Day1 > 30, __Day1 - 30, __Day1)
VAR __Month = IF(__Day1 > 30, 10, 9)
VAR __Fraction = __NFraction - __Day1
VAR __Date1 = DATE(__Year, __Month, __Day)
VAR __Weekday = WEEKDAY(__Date1)
VAR __Date =
SWITCH(TRUE(),
__Weekday IN { 1, 4, 6 }, __Date1 + 1,
__Weekday = 2 && __Fraction >= 23269/25920 && MOD(12*__G,19) > 11,__Date1+1,
__Weekday = 3 && __Fraction >= 1367/2160 && MOD(12*__G,19) > 6,__Date1+2,
__Date1
)
RETURN
__Date
My sincere apologies if there are any issues/misspellings, etc. I don't know what I don't know. Happy to be corrected by those who do.
eyJrIjoiZTdlOGQ2ZTktOTgyMC00MjIwLWFhMGYtYjNiZGNlMjQ3ZTg1IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9