Date.IsInNextNMonths

This function determines if the provided dateTime value occurs within the next specified number of months, based on the current date and time of the system. It should be noted that the function will r...

Syntax

Date.IsInNextNMonths(dateTime as any, months as number) as nullable logical

About

This function determines if the provided dateTime value occurs within the next specified number of months, based on the current date and time of the system. It should be noted that the function will return false if the value falls within the current month. dateTime: The date, datetime, or datetimezone value being assessed. months: The specified number of months to be considered.

Explanation

Check if the month following the current system time falls within the next two months. Utilize the Power Query function MDate.IsInNextNMonths with the parameter Date.AddMonths(DateTime.FixedLocalNow(), 1) and specify a range of 2 months. The output will indicate whether this condition is true.