Date.IsInPreviousQuarter

Date

Returns true if the date falls in the previous calendar quarter.

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

Syntax

Date.IsInPreviousQuarter(dateTime as any) as logical

Parameters

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

Return Value

logicaltrue 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])
)
Result
OrderID
OrderDate
13510/10/2025
23611/20/2025
33712/31/2025

Example 2: Flag last-quarter rows

Table.AddColumn(
    Sales,
    "IsLastQuarter", each Date.IsInPreviousQuarter([OrderDate]), type logical
)
Result
OrderID
OrderDate
IsLastQuarter
1349/15/2025FALSE
23510/10/2025TRUE
3423/8/2026FALSE

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
)
Result
OrderID
OrderDate
QuarterPeriod
13510/10/2025Previous Quarter
2381/10/2026Current Quarter
3423/8/2026Current Quarter

Compatibility

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