The Date.QuarterOfYear function tells you which quarter of the year a date falls in. It gives you a number from 1 to 4, so January to March is 1 and October to December is 4.
That makes it the go-to function for quarterly reports, whether you need a Quarter column, labels like Q1 or 2026-Q1, totals by quarter, or fiscal quarters. In this article, I’ll show you how it works with nine practical examples.
Follow along with the example file
Date.QuarterOfYear Function Examples.xlsx
In the example file, each example is its own query. To see the results, go to Data > Queries & Connections and double-click a query to open it in the Power Query editor.
Date.QuarterOfYear Function Syntax
Date.QuarterOfYear(dateTime as any) as nullable number
- dateTime – the date, datetime, or datetimezone value you want the quarter for.
What it returns – a number from 1 to 4 for the calendar quarter the date falls in. If dateTime is null, you get null back instead of an error.
The quarters are always calendar quarters: January to March is 1, April to June is 2, July to September is 3, and October to December is 4.
There’s no option to start the year in another month, but Example 7 shows how to get fiscal quarters anyway.
When to Use the Date.QuarterOfYear Function
Use this function when you need to:
- Find the quarter of a single date
- Add a Quarter column next to a column of dates
- Show the quarter as a label like Q1 or 2026-Q1
- Get the quarter from a date and time value
- Total amounts by quarter
- Work out fiscal quarters when your financial year doesn’t start in January
- Keep only the rows from one quarter
Example 1: Find the Quarter of a Date
Let’s start with the simplest use of the function.
Suppose you have the date August 14, 2026, and you want to know which quarter it falls in.
Create a new blank query (in Excel, go to Data > Get Data > From Other Sources > Blank Query) and type this formula in the formula bar:
= Date.QuarterOfYear(#date(2026,8,14))
Result: 3

Here, #date(2026,8,14) creates the date August 14, 2026. August is between July and September, so Date.QuarterOfYear returns 3.
Example 2: Add a Quarter Column to a Table
In real data, you’ll usually have a whole column of dates, not just one.
Below is an Orders table with the date of each online order, and I want the quarter of each order in a new Quarter column.

To follow along, select any cell in the Orders table and go to Data > From Table/Range. Power Query adds a Changed Type step.
Excel dates come into Power Query as date and time values, even when the cell shows only a date. So click the type icon in the Order Date header, pick Date, and choose Replace current.
The formula below starts from #"Changed Type", which is the name of that step. So the new column is added after the column types are set.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Quarter",each Date.QuarterOfYear([Order Date]),Int64.Type)
Result: A new Quarter column shows 1, 1, 1, 2, 2, 3, 4, and 4.

Here, the Table.AddColumn function adds the Quarter column, and the each keyword runs Date.QuarterOfYear on every row. [Order Date] picks the date from the same row, and Int64.Type makes the new column a Whole Number column.
Look at orders ORD-1043 and ORD-1044. The order on 3/31/2026 is in quarter 1, and the one on 4/1/2026 (April 1), just a day later, is in quarter 2.
The dates show as month/day/year because my computer uses US regional settings. On your screen they may appear in a different order, but the quarters are the same.
If you prefer clicking to typing, you can also select the Order Date column and go to Add Column > Date > Quarter > Quarter of Year. It uses the same Date.QuarterOfYear function.
Example 3: Show the Quarter as Q1 to Q4
A plain number like 2 doesn’t always say “quarter” to whoever reads your report. A label like Q2 is clearer.
Below is a Webinars table with the date of each webinar, and I want the quarter as a label like Q1 in a new Quarter column.

As in Example 2, load the table with Data > From Table/Range, and make sure the Changed Type step sets the Webinar Date column to the Date type.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Quarter",each "Q" & Text.From(Date.QuarterOfYear([Webinar Date])),type text)
Result: A new Quarter column shows Q1, Q2, Q2, Q3, and Q4.

Here, Date.QuarterOfYear gives the quarter number, and the Text.From function turns that number into text. The & then joins “Q” in front of it, so 2 becomes Q2.
Important: If you leave out Text.From and write "Q" & Date.QuarterOfYear([Webinar Date]), you get the error “We cannot apply operator & to types Text and Number.” Power Query won’t join text and a number until you turn the number into text.
Number.ToText works here too and gives the same Q2 result.
Example 4: Create a Year and Quarter Label
The quarter number on its own doesn’t include the year. So a date in January 2025 and a date in January 2026 both give you 1.
That’s a problem as soon as your data covers more than one year. Adding the year to the label fixes it.
Below is a Members table with the date each gym member joined, and I want a label like 2026-Q1 in a new Join Quarter column.

As in Example 2, load the table with Data > From Table/Range, and make sure the Changed Type step sets the Join Date column to the Date type.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Join Quarter",each Text.From(Date.Year([Join Date])) & "-Q" & Text.From(Date.QuarterOfYear([Join Date])),type text)
Result: A new Join Quarter column shows 2025-Q3, 2025-Q4, 2026-Q1, 2026-Q1, 2026-Q2, 2026-Q3, and 2026-Q4.

Here, the Date.Year function gets the year, Date.QuarterOfYear gets the quarter, and & joins them with “-Q” in between. So Christina Powell, who joined on 8/4/2025, gets 2025-Q3.
Putting the year first has a nice bonus. Because every label starts with a four-digit year, sorting this column A to Z also puts the quarters in date order, with 2025-Q4 before 2026-Q1.
Example 5: Get the Quarter From a Date and Time
Date.QuarterOfYear also works on values that include a time. The time part doesn’t change the quarter.
Below is a Tickets table with the date and time each support ticket was opened, and I want the quarter of each ticket in a new Quarter column.

Load the table with Data > From Table/Range, as in Example 2. This time, keep the Opened At column as Date/Time in the Changed Type step, because you don’t need to remove the time.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Quarter",each Date.QuarterOfYear([Opened At]),Int64.Type)
Result: A new Quarter column shows 1, 2, 2, 3, and 4.

Here, Date.QuarterOfYear reads only the date part of each value. Ticket TCK-301 was opened at 10:45 PM on 3/31/2026, the last evening of quarter 1, and it still counts as quarter 1.
A datetimezone value is a date and time with a time zone offset, like +05:30. Date.QuarterOfYear reads the date exactly as written in it and doesn’t convert it to another time zone first.
For example, Date.QuarterOfYear(#datetimezone(2026,7,1,0,30,0,5,30)) returns 3. That moment is still June 30 in UTC, but the date as written is July 1, so you get quarter 3.
Follow along with the example file
Date.QuarterOfYear Function Examples.xlsx
Example 6: Total Amounts by Quarter
Once you have a Quarter column, you can use it to add up amounts for each quarter.
Below is an OfficeExpenses table with the date, item, and amount of each office purchase, and I want the total spend for each quarter in a new summary table.

As in Example 2, load the table with Data > From Table/Range. Make sure the Changed Type step sets Purchase Date to the Date type and Amount to Decimal Number.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula to add the Quarter column:
= Table.AddColumn(#"Changed Type","Quarter",each Date.QuarterOfYear([Purchase Date]),Int64.Type)
Power Query names a step you add with the fx icon Custom1. Right-click it in the Applied Steps pane, choose Rename, and call it Added Quarter, because the next formula refers to the step by that name.
Then add another step and use this formula to group the rows by quarter:
= Table.Group(#"Added Quarter",{"Quarter"},{{"Total Spend",each List.Sum([Amount]),type number}})
Result: A table with four rows: quarter 1 has a Total Spend of 920, quarter 2 has 310, quarter 3 has 1215, and quarter 4 has 350.

Here, the first step adds a Quarter column, just like in Example 2. The second formula starts from #"Added Quarter", the step you just renamed.
The Table.Group function then puts all rows with the same quarter together. The List.Sum function adds up their amounts, so the three purchases in quarter 1 (120, 260, and 540) give 920.
All these purchases are from 2026, so grouping by quarter alone is fine. If your data covers more than one year, group by the year and quarter label from Example 4 instead, so Q1 2025 and Q1 2026 don’t get added together.
You can also do this without typing. Select the Quarter column and go to Transform > Group By.
In the Group By dialog, type Total Spend as the new column name, then pick Sum as the operation and Amount as the column.
Example 7: Get the Fiscal Quarter
This is where Date.QuarterOfYear needs a little help. Many companies run a financial year that doesn’t start in January, but the function only knows calendar quarters.
Say your financial year starts on April 1. Then April to June is fiscal quarter 1, and January to March is fiscal quarter 4.
Below is a PurchaseOrders table with the date of each purchase order, and I want the fiscal quarter in a new Fiscal Quarter column.

As in Example 2, load the table with Data > From Table/Range, and make sure the Changed Type step sets the PO Date column to the Date type.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Fiscal Quarter",each Date.QuarterOfYear(Date.AddMonths([PO Date],-3)),Int64.Type)
Result: A new Fiscal Quarter column shows 4, 4, 1, 1, 2, 3, and 3.

Here, the Date.AddMonths function moves each date 3 months back before Date.QuarterOfYear looks at it. That lines your fiscal year up with the calendar year, so April becomes January and lands in quarter 1.
So PO-5503, dated 4/1/2026, is in fiscal quarter 1. And PO-5501, dated 1/20/2026, moves back to October 2025, which puts it in fiscal quarter 4.
The number of months you move back is the number of months between January and your fiscal year’s first month. For a year starting on July 1, use -6, and for one starting on October 1, use -9.
Example 8: Keep Only the Rows From One Quarter
You can also use Date.QuarterOfYear inside a filter, to keep only the rows from the quarter you care about.
Below is an EventBookings table with the date of each booked event, and I want to keep only the events in quarter 4.

As in Example 2, load the table with Data > From Table/Range, and make sure the Changed Type step sets the Event Date column to the Date type.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.SelectRows(#"Changed Type",each Date.QuarterOfYear([Event Date]) = 4)
Result: Only three rows are left: BK-803 Charity Gala (10/10/2026), BK-805 Holiday Party (12/12/2026), and BK-806 Annual Conference (11/5/2026).

Here, the Table.SelectRows function keeps a row only when its quarter is 4. The Book Launch on 9/26/2026 is dropped, because September is in quarter 3.
All these events are in 2026. If your table has more than one year, quarter 4 of every year would pass this filter, so add a year check too, like each Date.Year([Event Date]) = 2026 and Date.QuarterOfYear([Event Date]) = 4.
Example 9: Handle Blank Dates
Real data often has gaps, so it’s worth knowing what Date.QuarterOfYear does with an empty cell.
Below is a ProjectTasks table with the due date of each task, where two tasks don’t have a due date yet, and I want the quarter each task is due in a new Due Quarter column.

As in Example 2, load the table with Data > From Table/Range, and make sure the Changed Type step sets the Due Date column to the Date type.
Add a new step (by clicking on the fx icon next to the formula bar) and use this formula:
= Table.AddColumn(#"Changed Type","Due Quarter",each Date.QuarterOfYear([Due Date]),Int64.Type)
Result: A new Due Quarter column shows 1, null, 3, null, and 4.

Here, the blank due dates come into Power Query as null. Date.QuarterOfYear returns null for them instead of an error, so the query keeps working and those two tasks simply have no quarter yet.
Text is a different story. If your dates are stored as text, like “2026-03-15”, you get the error “The Date value must contain the Date component.”
The fix is to change the column’s type to Date in the Changed Type step first. For a single text value, wrap it in the Date.From function, so Date.QuarterOfYear(Date.From("2026-03-15")) returns 1.
Other Excel Articles You May Also Like:
- Date.Month – Use Date.Month in Power Query M to get the month number from a date.
- Date.WeekOfYear – Use Date.WeekOfYear in Power Query M to get the week number of a date.
- Date.EndOfMonth – Use Date.EndOfMonth in Power Query M to get the last day of a month.
- Date.AddYears – Use Date.AddYears in Power Query M to add or subtract years from a date.
- Date.MonthName – Use Date.MonthName in Power Query M to get the month name from a date.
- Date.DaysInMonth – Use Date.DaysInMonth in Power Query M to get the number of days in a month.
- Date.EndOfWeek – Use Date.EndOfWeek in Power Query M to get the last day of a week.
- Date.StartOfMonth – Use Date.StartOfMonth in Power Query M to get the first day of the month.