Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Convert Year and Quarter into YYQQ using DAX

Hello, @Anonymous 

 

I have dataset that contains date and have to manually create the formula in excel to extract the Year and Quarter from the date and then upload it into Power BI. But, this is a very time consuming step as its required every time the data is downloaded.

 

Is there a way to convert it into the Power BI directly using DAX such that the formula will stay and when the file is refreshed it would automatically calculate the extracted Year and Quarter as YYQQ in a column?

 

Appreciate any help with this please.

 

Thanks

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Yes, I quickly tested this in one of my reports that contains a date column. Here are the steps that I did:

 

  1. Go to table view of the report. The column I used is called "Period" and formatted as a Date value. 
    Max__0-1727085852616.png
  2. Add a calculated column:
    Max__1-1727085955221.png
  3. Enter the code from my previous answer (might be required to change the column name of the Date column, e.g. mine is called Period):
    Max__2-1727086045189.png
  4. New columns gets calculated:
    Max__3-1727086066608.png

     



Did you do it the same way? At which point did you experience the error (and do you have some screenshots that would help me to better look into this)?

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks @Max_  , it's working fine now. I was able to get the date extract into this format. 

Max_
Helper I
Helper I

Hi @Anonymous ,

Have you tried creating a new calculated column and assemble the columns using the FORMAT function?

Date (YYQQ) = FORMAT([Date], "YY") & "Q" & FORMAT([Date], "q")

 
As an example, the date 31/01/2024 would be converted into 24Q1. Is this what you are looking for? 

Anonymous
Not applicable

Hi - Yes, but Power BI query gives me an error that the function FORMAT is not recognized. Also, it does not work as the Measure. Please could you check if this works at your end or I am missing something?

Hi @Anonymous ,

Yes, I quickly tested this in one of my reports that contains a date column. Here are the steps that I did:

 

  1. Go to table view of the report. The column I used is called "Period" and formatted as a Date value. 
    Max__0-1727085852616.png
  2. Add a calculated column:
    Max__1-1727085955221.png
  3. Enter the code from my previous answer (might be required to change the column name of the Date column, e.g. mine is called Period):
    Max__2-1727086045189.png
  4. New columns gets calculated:
    Max__3-1727086066608.png

     



Did you do it the same way? At which point did you experience the error (and do you have some screenshots that would help me to better look into this)?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors