Forum Discussion
SCNCKS1
3 years agoHelper I
converting dax to M
Hi - I found the code below that will create perpetual holiday for my date calendar in dax, I would like to create the same thing in M (Power query), is this possible? -- New Year's Day (incl...
- 3 years ago
pls try this
if Date.Month([Date]) = 12 and Date.Day([Date]) = 31 and Date.DayOfWeek([Date], 1 ) = 6 then "New Year's Day (Observed)" else if Date.Month([Date]) = 1 and Date.Day([Date]) = 2 and Date.DayOfWeek( [Date], 1 ) = 2 then "New Year's Day (Observed)" else if Date.Month([Date]) = 1 and Date.Day([Date]) = 1 and List.ContainsAny({ Text.From(Date.DayOfWeek([Date], 1 ))} , { "2".."6" })= true then "New Year's Day" else ""
Ahmedx
3 years agoSuper User
pls try this
if Date.Month([Date]) = 12 and Date.Day([Date]) = 31 and Date.DayOfWeek([Date], 1 ) = 6 then "New Year's Day (Observed)" else if
Date.Month([Date]) = 1 and Date.Day([Date]) = 2 and Date.DayOfWeek( [Date], 1 ) = 2 then "New Year's Day (Observed)" else if
Date.Month([Date]) = 1 and Date.Day([Date]) = 1 and List.ContainsAny({ Text.From(Date.DayOfWeek([Date], 1 ))} , { "2".."6" })= true then "New Year's Day" else ""