Relative date / today in Power Query IF / conditional column

Опубликовано: 15 Октябрь 2024
на канале: David Benaim
26,163
233

Power Query's conditional columns are super easy but they cannot work with comparing relative dates, you need custom code for that, but once you understand it there are dozens of date functions in Power Query. Remember to Wrap Date.From() around our functions to explicitly set the date format and always use upper case. If you want a copy of this workbook, leave me a comment & subscribe to my channel.

Learn all date functions here: https://docs.microsoft.com/en-us/powe...

Functions I showcase:
Today: Date.From(DateTime.LocalNow())
One quarter ago: Date.From(Date.AddQuarters(DateTime.LocalNow(),-1))
End of last month: Date.From(Date.EndOfMonth(DateTime.LocalNow()))

00:00 - Introduction
02:43 - Before today
05:55 - Before one quarter ago
08:44 - End of last month
10:38 - Filtering based on a relative date
11:54 - Date functions documentation