Dax Function: QUARTER

Category: Date and Time Functions

The QUARTER function in Power BI extracts the quarter from a given date and returns an integer value (1 to 4) representing the quarter of the year.

Purpose

Identify the fiscal or calendar quarter in which a specific date falls.

Type of Calculations

Date segmentation and period grouping based on quarters.

Practical Use Cases

  • Generating quarter-based sales or performance reports.
  • Creating fiscal year analyses.
  • Grouping data for quarterly comparisons.
				
					QUARTER(<date>)
				
			
ParameterTypeDescription
dateDatetimeA date value or a column containing date values.

How Does QUARTER Dax Function Works

  1. The QUARTER function calculates the quarter based on the month of the date provided:
    • January, February, March → Q1
    • April, May, June → Q2
    • July, August, September → Q3
    • October, November, December → Q4
  2. It maps the input month to its respective quarter using predefined logic.

What Does It Return?

  • Type: Integer.
  • Meaning: Returns an integer between 1 and 4 corresponding to the quarter of the given date:
    • 1 = January to March
    • 2 = April to June
    • 3 = July to September
    • 4 = October to December

When Should We Use It?

  • When creating quarterly summaries for KPIs like revenue, costs, or performance.
  • For fiscal quarter-based filtering and grouping.
  • To perform year-over-year analysis at the quarterly level.

Examples

Basic Usage

Find the quarter of a specific date:

				
					QuarterNumber = QUARTER(DATE(2025, 5, 15))
				
			

Output: 2 (May falls in Q2).

Column Usage:

Add a calculated column to determine the quarter for each record:

				
					QuarterColumn = QUARTER(Table[Date])
				
			

Output: For a table of dates, it returns the corresponding quarter number for each date.

Advanced Usage

Combine with other functions to calculate the start of the quarter:

				
					StartOfQuarter = DATE(YEAR(Table[Date]), (QUARTER(Table[Date]) - 1) * 3 + 1, 1)
				
			

Output: Calculates the first day of the quarter for each date in the column.

Tips and Tricks

  • Quarter Names: Combine QUARTER with the CONCATENATE or FORMAT functions to generate labels like “Q1 2025.”
    QuarterLabel = "Q" & QUARTER(Table[Date]) & " " & YEAR(Table[Date])
  • Fiscal Quarters: Use custom logic to account for fiscal quarters starting in months other than January.
  • Performance: Use measures instead of calculated columns to improve performance in large datasets.

Potential Pitfalls

  • Date Format: Ensure the input is a valid date; otherwise, the function will return an error.
  • Fiscal Year Adjustments: The function assumes quarters start in January. For custom fiscal years, combine with other logic.

Performance Impact of QUARTER DAX Function:

  • Calculated Columns: Use sparingly in large datasets; opt for measures where possible.
  • Refresh Dependency: Values recalculate during data refresh, ensuring up-to-date grouping.

Related Functions You Might Need

  • YEAR: Extracts the year from a date.
  • MONTH: Returns the month number of a date.
  • FORMAT: Formats a date or number as a string for labeling.
  • STARTOFQUARTER: Returns the first date of the quarter for a given date column.

Want to Learn More?
For more information, check out the official Microsoft documentation for QUARTER You can also experiment with this function in your Power BI reports to explore its capabilities.

Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.

1. What does the QUARTER function in Power BI do?

It returns the quarter number (1 to 4) for a given date, based on the calendar year.

2. Can I use the QUARTER function for fiscal quarters?

Not directly. You’ll need custom logic to handle fiscal years starting in months other than January.

3. Does the QUARTER function work with invalid dates?

No, the input must be a valid datetime value or column.

4. How can I label quarters with years, like 'Q1 2025'?

Use the CONCATENATE or FORMAT functions alongside QUARTER:

"Q" & QUARTER(Date) & " " & YEAR(Date)
5. What is the difference between QUARTER and STARTOFQUARTER?

QUARTER returns the quarter number, while STARTOFQUARTER returns the first date of that quarter.

Established in 2020, Lets Viz Technologies provides a full range of high-quality data analysis and data visualization services. We are also an authorized Zoho Partner.

 

Contact

WeWork Berger Delhi One, C-001/A2, Sector 16B, Noida, Uttar Pradesh 201301

0124-502-5592
info@lets-viz.com

We are Social

Trust Pilot Reviews