Date.IsInCurrentDay Function in Power Query
The Date.IsInCurrentDay function in Power Query (M language) checks whether a given date, datetime, or datetimezone value falls within the current day based on the system date and time.
Syntax
Date.IsInCurrentDay( dateTime as any ) as nullable logical
The function has the following parameter:
- dateTime: A value of type
date
,datetime
, ordatetimezone
that you want to evaluate.
Return Value
- true → if the value occurs within the current day.
- false → if the value occurs outside the current day.
- null → if the input is null.
Assume today is 24 August 2025:
Example: A date that is today.
Power Query M
let Source = Date.IsInCurrentDay(#date(2025, 8, 24)) in Source
The output of the above code is logical value true.
Example: A date that is not today.
Power Query M
let Source = Date.IsInCurrentDay(#date(2025, 8, 23)) in Source
The output of the above code is logical value false.
Example: With datetime.
Power Query M
let Source = Date.IsInCurrentDay(#datetime(2025, 8, 24, 15, 30, 0)) in Source
The output of the above code is logical value true.
Example: With datetimezone.
Power Query M
let Source = Date.IsInCurrentDay(#datetimezone(2025, 8, 24, 15, 30, 0, 5, 30)) in Source
The output of the above code is logical value true.