Downloads
Power Query MDateBeginner

Date.EndOfQuarter

Returns the last day of the calendar quarter that contains a date.

Syntax
Date.EndOfQuarter(dateTime as any) as date

Returns: The last day of the quarter as a date, or null when the input is null.

What it does

Date.EndOfQuarter returns the last day of the quarter, which is March 31, June 30, September 30 or December 31 for a calendar quarter. Quarter end is the date that many tax deposits, covenant tests and board reports use, so this is the value to use when a report says "as of quarter end".

Syntax and arguments

Example

A covenant test is run at each quarter end. Every transaction is tagged with the quarter end date it falls under, so the test uses the right balance date.

let
    Transactions = #table(type table [Txn = text, TxnDate = date, Amount = number],
        {{"T-1", #date(2026, 2, 14), 400}, {"T-2", #date(2026, 10, 29), 900}}),
    TestDate = Table.AddColumn(Transactions, "QuarterEnd", each Date.EndOfQuarter([TxnDate]), type date)
in
    TestDate

The February transaction belongs to the quarter ending March 31, 2026. The October transaction belongs to the quarter ending December 31, 2026.

Example: a second, different use

Compare a balance at each quarter end by grouping the balance rows on the quarter end date.

Things to watch

In business terms

Quarter end tests, covenant calculations, sales tax returns and board reporting are all dated to quarter end. Tagging every row with the quarter end date means a late entry is still counted in the right quarter.

Related functions

All Power Query M functions · View as Markdown · M basics