Date.IsInNextNYears Function in Power Query

The Date.IsInNextNYears function in Power Query indicates whether the given datetime value dateTime occurs during the next number of years, as determined by the current date and time on the system.

Syntax

Date.IsInNextNYears(
    dateTime as any, 
    years as number
) as nullable logical

The function has the following parameters:

Return Value:

Example: Assume today’s date is 24 August 2025.

Power Query M

let
    Source = Date.IsInNextNYears(#date(2027, 3, 14), 2)
in
    Source       

The output of the above code is a logical value true.