Date.IsInNextNYears

This function determines if a specific datetime value, dateTime, falls within the next number of years from the current date and time on the system. It is important to note that the function will retu...

Syntax

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

About

This function determines if a specific datetime value, dateTime, falls within the next number of years from the current date and time on the system. It is important to note that the function will return false if the dateTime value is within the current year. Parameters: - dateTime: A date, datetime, or datetimezone value to be assessed. - years: The number of years to be considered.

Explanation

Check if the date one year ahead of the current system time falls within the next two years. Power Query function MDate.IsInNextNYears is utilized to determine this by adding one year to the current date and checking if it falls within the next two years. The output of this operation will result in the value "true" if the date is within the specified timeframe.