To implement this recipe, perform the following steps:
- Create the following columns in the R03_Years table:
IsLeapYear =
VAR __Year = INT('R03_Years'[Value])
VAR __Div4 = IF(MOD(__Year,4)=0,TRUE(),FALSE())
VAR __Div100 = IF(MOD(__Year,100)=0,TRUE(),FALSE())
VAR __Div400 = IF(MOD(__Year,400)=0,TRUE(),FALSE())
VAR __IsLeapYear =
SWITCH(TRUE(),
__Div4 && NOT(__Div100),TRUE(),
__Div4 && __Div100 && __Div400,TRUE(),
FALSE()
)
RETURN __IsLeapYear