Date.StartOfQuarter

Date

Returns the first day of the quarter containing the given date.

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

Syntax

Date.StartOfQuarter(dateTime as any) as any

Parameters

NameTypeRequiredDescription
dateTimeanyYesA date, datetime, or datetimezone value.

Return Value

anyA date, datetime, or datetimezone value representing the first day of the quarter.

Remarks

Date.StartOfQuarter returns the first day of the calendar quarter (Q1: January 1, Q2: April 1, Q3: July 1, Q4: October 1) that contains the given date, datetime, or datetimezone value. The return type matches the input type. This is useful for period-over-period comparisons, quarter-to-date filters, and grouping data by quarter.

Pair with Date.EndOfQuarter to construct inclusive quarter-range filters: [OrderDate] >= Date.StartOfQuarter(refDate) and [OrderDate] <= Date.EndOfQuarter(refDate). When passed a plain date, the result is also a date (unlike Date.EndOfQuarter, which returns a datetime).

For the current quarter start, use Date.StartOfQuarter(Date.From(DateTime.LocalNow())). To get the start of the prior quarter, apply Date.AddQuarters first: Date.StartOfQuarter(Date.AddQuarters(Date.From(DateTime.LocalNow()), -1)).

Examples

Example 1: Add quarter-start date to the Sales table

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(Sales, 5),
        {"OrderID", "OrderDate"}
    ),
    "QuarterStart", each Date.StartOfQuarter([OrderDate]), type date
)
Result
OrderID
OrderDate
QuarterStart
111/15/20241/1/2024
221/18/20241/1/2024
332/1/20241/1/2024
442/10/20241/1/2024
553/5/20241/1/2024

Example 2: Start of quarter for all four quarters

#table(
    type table [Quarter = text, StartDate = date],
    {
        {"Q1", Date.StartOfQuarter(#date(2024, 2, 15))},
        {"Q2", Date.StartOfQuarter(#date(2024, 5, 20))},
        {"Q3", Date.StartOfQuarter(#date(2024, 8, 15))},
        {"Q4", Date.StartOfQuarter(#date(2024, 11, 1))}
    }
)
Result
Quarter
StartDate
1Q11/1/2024
2Q24/1/2024
3Q37/1/2024
4Q410/1/2024

Example 3: Filter orders for the current quarter to date

let
    Today = Date.From(DateTime.LocalNow()),
    QuarterStart = Date.StartOfQuarter(Today)
in
    Table.SelectRows(
        Sales,
        each [OrderDate] >= QuarterStart and [OrderDate] <= Today
    )
Applied Steps

The final output — filters the Sales table to rows where OrderDate falls from the start of the current quarter through today.

OrderID
CustomerName
Product
Category
UnitPrice
Quantity
OrderDate
Region
17CharlieGadget BGadgets5034/1/2024West
28DianaWidget CWidgets1584/15/2024North

Compatibility

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