OpenBI Docs Buy

PREVIOUSDAY

The day before the first date in the filter context.

Group: Time intelligence. Compatible with DAX.

Syntax

PREVIOUSDAY ( <dates> )
ParameterTypeDescription
datesDatesA column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model.

Returns

Table. The day before the first date in the filter context, when the column holds it.

Remarks

  • The day is the calendar's previous day, not the column's previous date: on a column of business days, the day before a Monday is a Sunday the column lacks, and the result is empty, which shows as blank.
  • Given a column, it reads the dates visible in the current filter context; in a row context, such as ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates.
  • With several dates in the filter context, it is the day before the first of them.
  • Given a calendar instead of a column, it works on the calendar's own periods (fiscal years, retail months of four or five weeks, ISO weeks). A filter on a category the calendar does not define, such as a month on a calendar of weeks, can make the call an error.

Examples

The price the day before

Monday 7 September 2026 has no previous day in the column, so its price is blank.

EVALUATE
CALCULATETABLE (
    ADDCOLUMNS (
        DATESBETWEEN ( Prices[Date], DATE ( 2026, 9, 3 ), DATE ( 2026, 9, 8 ) ),
        "Close", [Close price],
        "Close the day before", CALCULATE ( [Close price], PREVIOUSDAY ( Prices[Date] ) )
    ),
    Prices[Commodity] = "Malting barley"
)
ORDER BY Prices[Date]
Prices[Date]CloseClose the day before
2026-09-034524.594529.37
2026-09-044542.634524.59
2026-09-074583.88(blank)
2026-09-084503.154583.88

NEXTDAY, PREVIOUSMONTH, DATEADD, FIRSTDATE.

Last updated · OpenBI Studio 0.3.74