Forum Discussion
pacofq
7 years agoAdvocate I
Power Query - Next Work Day
Hi evryone, I have a date table structured like this [Date] 2017-01-01 2017-01-02 ... I'm trying to generate a calculated column that return the "next work (open) day" relative to m...
Zubair_Muhammad
7 years agoCommunity Champion
Try adding this new custom column
=let mydate=Date.DayOfWeek(Date.From([Date])) in
if mydate=5 then Date.AddDays([Date],3)
else
if List.AnyTrue({mydate=0,mydate=6})=false
then
Date.AddDays([Date],1)
else null
= Table.AddColumn(#"Added Custom", "Custom", each let mydate=Date.DayOfWeek(Date.From([Date])) in
if mydate=5 then Date.AddDays([Date],3) else if List.AnyTrue({mydate=0,mydate=6})=false then Date.AddDays([Date],1) else null)