Date.IsInPreviousYear

This function evaluates if the provided datetime value, dateTime, falls within the previous year based on the current date and time on the system. It is important to note that the function will return...

Syntax

Date.IsInPreviousYear(dateTime as any) as nullable logical

About

This function evaluates if the provided datetime value, dateTime, falls within the previous year based on the current date and time on the system. It is important to note that the function will return false if the value is within the current year. The input parameter, dateTime, can be a date, datetime, or datetimezone value for evaluation purposes.

Explanation

To confirm whether the year before the current system time falls within the previous year, we can utilize the Power Query function MDate.IsInPreviousYear(Date.AddYears(DateTime.FixedLocalNow(), -1)). This function will return a boolean output of true if the previous year is indeed the year before the current system time.