Forum Discussion
Anonymous
5 years agoNot applicable
Function - get previous workday date
I am looking for some power query gurus help here , as am totally unfamiliar with M language . i would need to create a function to get my previous working day date . E.g. if today is May 31...
- 5 years ago
Anonymous
Add the following code as a new custom column:let today = Date.From(DateTime.LocalNow()), d = Date.DayOfWeek(today, Day.Monday) in if d = 6 then Date.AddDays(today, - 2) else if d = 0 then Date.AddDays(today, - 3) else Date.AddDays(today, - 1)
Fowmy
5 years agoSuper User
Anonymous
Add the following code as a new custom column:
let
today = Date.From(DateTime.LocalNow()),
d = Date.DayOfWeek(today, Day.Monday)
in
if d = 6 then
Date.AddDays(today, - 2)
else if d = 0 then
Date.AddDays(today, - 3)
else
Date.AddDays(today, - 1)Anonymous
5 years agoNot applicable
Thanks Fowmy really appreciate your time for responding to my query .