Date.IsInPreviousWeek

Updated on

Date.IsInPreviousWeek is a Power Query M function that indicates whether the given date(time) value occurs during the previous week, as determined by the system. The function returns a boolean value (true or false).

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Date.IsInPreviousWeek( dateTime as any ) as nullable logical

Description

Date.IsInPreviousWeek identifies if dateTime (of type date, datetime, or datetimezone) is within the week preceding the current system date and time, not considering the current week’s dates.

Examples

Determine if the week before the current system time is in the previous week.

// Output: true
Date.IsInPreviousWeek( Date.AddDays( DateTime.FixedLocalNow(), -7 ) )

Other functions related to Date.IsInPreviousWeek are:

BI Gorilla Blog

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-isinpreviousweek