Date.IsInPreviousNDays

This function checks if the provided date and time value (dateTime) falls within the specified number of days prior to the current date and time on the system. It should be noted that this function wi...

Syntax

Date.IsInPreviousNDays(dateTime as any, days as number) as nullable logical

About

This function checks if the provided date and time value (dateTime) falls within the specified number of days prior to the current date and time on the system. It should be noted that this function will return false for any value that falls within the current day. Parameters: - dateTime: The date, datetime, or datetimezone value to be evaluated. - days: The number of days to consider.

Explanation

Check if the date of the day before the current system time falls within the last two days. The Power Query function MDate.IsInPreviousNDays is used for this purpose by subtracting one day from the current date and checking if it is within a range of two days. The output will be "true" if the date falls within the specified time frame.