How can I convert a date into a quarter and year in Power BI?

To convert a date into a quarter and year in Power BI, you can use the DAX formula “QUARTER” to extract the quarter from a given date and “YEAR” to extract the year. This will allow you to create new columns in your dataset that display the quarter and year for each date. You can also use the “CALENDAR” function to create a new date table with the quarter and year columns already included. This will make it easier to create visualizations and analyze data based on quarters and years.


You can use the following syntax in DAX to convert a date to a quarter and year format in Power BI:

qtr_year = "Q" & FORMAT('my_data'[Date], "Q") & " " & FORMAT('my_data'[Date], "YYYY") 

This particular example creates a new column named qtr_year that contains the quarter and year of the corresponding date in the Date column of the table named my_data.

The following example shows how to use this syntax in practice.

Example: Convert Date to Quarter and Year in Power BI

Suppose we have the following table in Power BI that contains information about total sales made on various dates by some company:

Suppose that we would like to display each of the dates in the Date column in a quarter and year format.

To do so, click the Table tools tab, then click the icon called New column:

Then type the following formula into the formula bar:

qtr_year = "Q" & FORMAT('my_data'[Date], "Q") & " " & FORMAT('my_data'[Date], "YYYY") 

This will create a new column named qtr_year that displays the corresponding dates in the Date column in a quarter and year format:

Power BI convert date to quarter and year

Note that the & symbols in the DAX formula allow us to concatenate text values.

If we’d like, we could also spell out the word “Quarter” by using the following formula instead:

qtr_year = "Quarter " & FORMAT('my_data'[Date], "Q") & " " & FORMAT('my_data'[Date], "YYYY") 

Feel free to use whichever formula you prefer depending on how you would like the resulting quarter and year to be displayed.

Note: You can find the complete documentation for the FORMAT function in DAX .

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:


Power BI: How to Convert Date to Month and Year in Power BI

x