How can I get last Friday date in a Custom Column of Power Query please?
Today is 28/07/2021 so last Friday date was 23/07/2021.
Solved! Go to Solution.
Here is one way to do it in a custom column.
= if Date.DayOfWeek([Date]) >= 5 then Date.AddDays(Date.StartOfWeek([Date]), 5) else Date.AddDays(Date.StartOfWeek([Date]), -2)
@CNENFRNL thanks but not what I wanted.
This is giving me date of 2 days ago i.e. 24/07/2021 which was Saturday. Can it be dynamic to calculate from any date what was last Friday date?
And here is another way.
= List.Max(List.Select(List.Dates(Date.AddDays([Date], -6),7,#duration(1,0,0,0)), each Date.DayOfWeek(_) = 5))
Learn how to create your own user groups today!
Click here to read more about the October 2021 Release!
Check out the new Power Platform Community Connections gallery!
Mark your calendars and join us for our next Power BI Dev Camp!