Date.IsInPreviousDay

Date

Returns true if the date was yesterday.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Date.IsInPreviousDay(dateTime as any) as logical

Parameters

NameTypeRequiredDescription
dateTimeanyYesA date, datetime, or datetimezone value to test.

Return Value

logicaltrue if the date falls on yesterday's date, false otherwise.

Remarks

Date.IsInPreviousDay returns true if the input date falls on the calendar day immediately preceding today's date (DateTime.LocalNow() - 1 day). It does not include today itself. The function is re-evaluated on each query refresh, making it useful for "yesterday's transactions" or daily comparison dashboards.

This function checks exactly one day. To check a broader historical window, use Date.IsInPreviousNDays. To include today in the filter, combine with or Date.IsInCurrentDay([OrderDate]).

As with all Date.IsIn* functions, the reference is DateTime.LocalNow(). In cloud environments, this is the server's UTC clock. Day boundaries may differ from your local timezone if there is a large UTC offset.

Examples

Example 1: Filter yesterday's orders

Table.SelectRows(
    Sales,
    each Date.IsInPreviousDay([OrderDate])
)
Result
OrderID
OrderDate
1413/7/2026

Example 2: Flag yesterday's rows

Table.AddColumn(
    Sales,
    "IsYesterday", each Date.IsInPreviousDay([OrderDate]), type logical
)
Result
OrderID
OrderDate
IsYesterday
1403/6/2026FALSE
2413/7/2026TRUE
3423/8/2026FALSE

Example 3: Flag today and yesterday together

Table.AddColumn(
    Sales,
    "TodayOrYesterday",
    each Date.IsInCurrentDay([OrderDate]) or Date.IsInPreviousDay([OrderDate]),
    type logical
)
Result
OrderID
OrderDate
TodayOrYesterday
1403/6/2026FALSE
2413/7/2026TRUE
3423/8/2026TRUE

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks