How to Get Quarter from Date in Power BI
Figuring out the fiscal quarter for a given date is a common task in business reporting, allowing you to slice your data into meaningful chunks for analysis. Power BI makes this simple with its powerful DAX formula language. This guide will walk you through everything you need to know to extract the quarter from any date, from creating simple calculated columns to handling custom fiscal years.
Why Quarters Matter in Business Reporting
Analyzing performance on a quarterly basis helps you identify trends, measure progress against goals, and make strategic decisions. For many businesses, sales cycles, marketing campaigns, and financial projections are planned around quarters. For example, an e-commerce store might analyze shipping performance in Q4 to prepare for the holiday rush, while a SaaS company might review new subscriptions quarter-over-quarter to gauge growth.
By adding a dedicated "Quarter" field to your Power BI data model, you enable your entire team to easily filter, slice, and visualize data in a way that aligns directly with your business rhythm. It turns a raw list of dates into an actionable reporting dimension.
A Quick Intro to Date Tables and DAX
Before jumping into the formulas, it’s important to understand two core concepts in Power BI: DAX and the Date Table.
- DAX (Data Analysis Expressions) is the formula language used in Power BI. Think of it as an advanced version of Excel formulas, but designed specifically for data analysis and modeling. We'll be using DAX to create our quarter fields.
- A Date Table (sometimes called a Calendar Table) is a dedicated table in your data model that contains a list of every single date over a given period (e.g., January 1, 2020 – December 31, 2025). Using a date table is a best practice in Power BI. It acts as a central source for all date-related information, ensuring consistency and enabling powerful time-intelligence functions.
While you can add quarter columns to any table that has a date, it’s highly recommended to create them within your dedicated Date Table.
Method 1: Creating a Quarter Calculated Column
A calculated column is a new column you add to your table using a DAX formula. The formula is evaluated for each row in the table, and the result is stored within your data model. This is the most common and versatile method for adding quarter attributes.
When to Use a Calculated Column
Creating a calculated column is the right choice when you want to use the quarter as a label for filtering, grouping, or slicing your data. Because the values are pre-calculated and stored, they work perfectly in:
- Slicers: Letting users easily filter the report page to a specific quarter (e.g., Q3).
- Chart Axes: Showing performance across different quarters in a line or bar chart.
- Table and Matrix Rows/Columns: Grouping values by quarter.
Step-by-Step: Adding a Quarter Column
- Navigate to the Data view in Power BI Desktop by clicking the table icon on the left-hand navigation pane.
- From the Fields pane on the right, select your Date table.
- In the top ribbon, under Table tools, click New column. A formula bar will appear above your table.
- Enter one of the DAX formulas below into the formula bar and press Enter.
DAX Formulas for a Standard Calendar Quarter
Here are three different DAX formulas you can use, depending on how you want to display the quarter.
Formula A: Just the Quarter Number (1, 2, 3, or 4)
For a simple numeric output, the QUARTER() function is all you need. It reads the month from your date column and returns the corresponding quarter number.
Quarter Number = QUARTER('Date'[Date])
(Replace 'Date'[Date] with your date table name and date column name.)
This formula would return 1 for any date in January, February, or March, 2 for April, May, or June, and so on.
Formula B: Formatted as "Q1", "Q2"....
While a number is useful, a format like "Q1" is much more readable in reports. We can achieve this by combining the QUARTER() function with text using the ampersand (&) operator.
Quarter = "Q" & QUARTER('Date'[Date])
This creates a text-based column that shows values like "Q1", "Q2", "Q3", and "Q4", making your visualizations clearer for your audience.
Formula C: Including the Year ("Q1 2024")
When analyzing data over multiple years, just having "Q1" isn't enough - you need to know which Q1. This formula combines the quarter and the year for ultimate clarity.
Quarter & Year = "Q" & QUARTER('Date'[Date]) & " " & YEAR('Date'[Date])
This will generate values like "Q1 2023", "Q2 2023", etc. This is perfect for showing trends over time in a line chart. Pro Tip: When using a text column like this one for sorting, Power BI will sort it alphabetically (e.g., Q1 2024, Q1 2025, Q2 2024). You'll want to create another numeric column (like YearQuarter, e.g., 202401) and use the "Sort by column" feature in Power BI to sort your "Quarter & Year" column correctly.
Method 2: Creating a Quarter Measure
A second way to use quarters in Power BI is with a measure. Unlike a calculated column, a measure isn't pre-calculated for every row. Instead, it’s calculated dynamically at the time you use it in a visualization, based on the filters applied in your report.
When to Use a Measure
Measures are best for calculating aggregations or performing on-the-fly calculations. You wouldn't use a measure to slice or filter a report by quarter, but you could use a measure to:
- Display the current quarter number in a KPI card.
- Calculate a value dynamically based on a user's date selection.
Example DAX Formula for a Quarter Measure
Let's say you want to create a card visual that always shows what quarter we are in today. A measure is perfect for this.
- Click on your Date table in the Fields pane.
- In the ribbon, click New measure.
- Enter this formula:
Current Quarter = "Current Quarter: Q" & QUARTER(TODAY())
Now, if you add this measure to a card visual, it will dynamically display the current quarter based on today's date. The TODAY() function ensures the value is always up-to-date.
Handling Custom Fiscal Years
What if your company's fiscal year doesn't start in January? This is a common scenario - many businesses have fiscal years starting in July, October, or April. Power BI's standard QUARTER() function won't work correctly in these cases because it is based on the calendar year. Fortunately, you can write a flexible DAX calculated column to handle any fiscal year start month.
The Logic for Fiscal Quarters
Let's say your fiscal year starts in July. This means:
- Fiscal Q1: July, August, September
- Fiscal Q2: October, November, December
- Fiscal Q3: January, February, March
- Fiscal Q4: April, May, June
The DAX formula below lets you define a start month and then calculates the appropriate fiscal quarter.
DAX Formula for a Custom Fiscal Quarter
This formula uses variables (VAR) to make it easy to read and modify. Create it as a new calculated column in your Date table.
`Fiscal Quarter = VAR FiscalYearStartMonth = 7 // Set your fiscal year start month (e.g., 7 for July) VAR CurrentMonth = MONTH('Date'[Date]) VAR FiscalShift = IF(CurrentMonth >= FiscalYearStartMonth, CurrentMonth - FiscalYearStartMonth + 1, CurrentMonth + 12 - FiscalYearStartMonth + 1)
RETURN "FQ" & CEILING(FiscalShift / 3, 1)`
Breaking Down the Formula:
VAR FiscalYearStartMonth = 7: This is the only line you need to change. Set it to the number of your starting month (1 for Jan, 2 for Feb, etc.).VAR CurrentMonth: Gets the calendar month number (1-12) for the current row.VAR FiscalShift: This is the core logic. It "shifts" the calendar. For example, if your year starts in July (7), it treats July as month 1, August as month 2, and so on.RETURN "FQ" & CEILING(FiscalShift / 3, 1): It takes the shifted month number, divides by 3, and rounds up to the nearest whole number using theCEILINGfunction. This correctly groups the months into quarters. We add "FQ" to label it clearly as a fiscal quarter.
Just like with the calendar quarter, you can also create a fiscal year column and combine them to create a value like "FQ1 2024" for sorting and analyzing across fiscal years.
Final Thoughts
Adding quarter context to your date table is a fundamental step in building powerful and user-friendly Power BI reports. By using a calculated column, you can easily create fields for slicing and dicing your data by calendar or fiscal quarter. It moves you from raw data to business insights that are directly aligned with how your organization plans and operates.
We built Graphed to remove the friction between raw data and actionable analysis. Instead of manually writing DAX or configuring visualizations, you can simply connect your live data sources and ask questions in plain English like, “Show me sales by fiscal quarter for a July year-start,” and instantly get the charts and reports you need. It automates the technical work so you can focus on building your data-driven strategy.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.