Edit

Share via


PREVIOUSWEEK

Applies to: Calculated column Calculated table Measure Visual calculation

Note

This function is discouraged for use in visual calculations as it likely returns meaningless results.

Returns a table of all dates from the previous week, based on the first date in the current context. The table contains all primary tagged columns and all time related columns.

Note

Week functions only work with calendar based time intelligence.

Syntax

PREVIOUSWEEK(<calendar>)

Parameters

Term Definition
calendar A calendar reference

Return value

A table that contains all primary tagged columns and all time related columns.

Remarks

  • Constraints on Boolean expressions are described in the topic, CALCULATE function.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example for calendar based time intelligence

The following sample formula creates a measure that calculates the 'previous week sales' for Internet sales in terms of fiscal calendar.

= CALCULATE (
    SUM ( InternetSales_USD[SalesAmount_USD] ),
    PREVIOUSWEEK ( FiscalCalendar )
)

Time intelligence functions Date and time functions PREVIOUSDAY function PREVIOUSMONTH function PREVIOUSQUARTER function PREVIOUSYEAR function