DateTime.IsInPreviousNSeconds Function in Power Query

The DateTime.IsInPreviousNSeconds function in Power Query indicates whether the given datetime value occurs during the previous number of seconds, as determined by the current date and time on the system.

Syntax

DateTime.IsInPreviousNSeconds(dateTime as any, seconds as number) as nullable logical

The function has the following parameters:

Example: Let’s the current date and time in the system is 13 April 2025 10:57AM.

Power Query M

let
    Source = DateTime.IsInPreviousNSeconds(#datetime(2025,4,13,10,56,10), 1000)
in
    Source         

The output of the above code is TRUE.

Note: This function will return false when passed a value that occurs within the current second.