Date.AddQuarters
Moves a date, datetime or datetimezone by quarters of three calendar months.
Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Date.AddQuarters(dateTime as any, numberOfQuarters as number) as any
| Parameter | Type | Description |
|---|---|---|
dateTime | any | The date, datetime or datetimezone to move; null gives null. |
numberOfQuarters | number | How many quarters to move: negative goes back in time. |
Returns
any. The same kind of value as given, moved by that many quarters.
Remarks
- A date gives a date, a datetime a datetime, a datetimezone a datetimezone with its offset unchanged; the time of day is kept.
- A quarter is three calendar months, so the day of the month is kept as
Date.AddMonthskeeps it.
Examples
One quarter later
Date.AddQuarters(#date(2024, 5, 14), 1)
#date(2024, 8, 14)
From a day the target month lacks
Date.AddQuarters(#date(2024, 11, 30), 1)
#date(2025, 2, 28)
Three months after 30 November is February, which ends on the 28th in 2025.
Related functions
Date.AddMonths, Date.QuarterOfYear, Date.StartOfQuarter, Date.EndOfQuarter.