Date.IsInPreviousDay
DateReturns true if the date was yesterday.
Syntax
Date.IsInPreviousDay(dateTime as any) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
dateTime | any | Yes | A date, datetime, or datetimezone value to test. |
Return Value
logical — true 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])
)OrderID | OrderDate | |
|---|---|---|
| 1 | 41 | 3/7/2026 |
Example 2: Flag yesterday's rows
Table.AddColumn(
Sales,
"IsYesterday", each Date.IsInPreviousDay([OrderDate]), type logical
)OrderID | OrderDate | IsYesterday | |
|---|---|---|---|
| 1 | 40 | 3/6/2026 | FALSE |
| 2 | 41 | 3/7/2026 | TRUE |
| 3 | 42 | 3/8/2026 | FALSE |
Example 3: Flag today and yesterday together
Table.AddColumn(
Sales,
"TodayOrYesterday",
each Date.IsInCurrentDay([OrderDate]) or Date.IsInPreviousDay([OrderDate]),
type logical
)OrderID | OrderDate | TodayOrYesterday | |
|---|---|---|---|
| 1 | 40 | 3/6/2026 | FALSE |
| 2 | 41 | 3/7/2026 | TRUE |
| 3 | 42 | 3/8/2026 | TRUE |