Date.IsInPreviousQuarter
DateReturns true if the date falls in the previous calendar quarter.
Syntax
Date.IsInPreviousQuarter(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 in the quarter immediately before the current quarter, false otherwise.
Remarks
Date.IsInPreviousQuarter returns true if the input date falls within the calendar quarter immediately preceding the current quarter (as determined by DateTime.LocalNow()). For example, if today is in Q1 (Jan–Mar), this function returns true for any date in Q4 (Oct–Dec) of the prior year. The function is re-evaluated on each query refresh.
This is one of the most useful Date.IsIn* functions for quarter-over-quarter comparison reporting. It matches exactly one quarter — the immediately prior one. For a broader historical window, use Date.IsInPreviousNQuarters. To include the current quarter as well, add or Date.IsInCurrentQuarter([OrderDate]).
Examples
Example 1: Filter last quarter's orders
Table.SelectRows(
Sales,
each Date.IsInPreviousQuarter([OrderDate])
)OrderID | OrderDate | |
|---|---|---|
| 1 | 35 | 10/10/2025 |
| 2 | 36 | 11/20/2025 |
| 3 | 37 | 12/31/2025 |
Example 2: Flag last-quarter rows
Table.AddColumn(
Sales,
"IsLastQuarter", each Date.IsInPreviousQuarter([OrderDate]), type logical
)OrderID | OrderDate | IsLastQuarter | |
|---|---|---|---|
| 1 | 34 | 9/15/2025 | FALSE |
| 2 | 35 | 10/10/2025 | TRUE |
| 3 | 42 | 3/8/2026 | FALSE |
Example 3: Tag rows with current or previous quarter labels
Table.AddColumn(
Sales,
"QuarterPeriod",
each
if Date.IsInCurrentQuarter([OrderDate]) then "Current Quarter"
else if Date.IsInPreviousQuarter([OrderDate]) then "Previous Quarter"
else "Other",
type text
)OrderID | OrderDate | QuarterPeriod | |
|---|---|---|---|
| 1 | 35 | 10/10/2025 | Previous Quarter |
| 2 | 38 | 1/10/2026 | Current Quarter |
| 3 | 42 | 3/8/2026 | Current Quarter |