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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Sorting a Quarter year column based on dates PowerBI DAX

Hi all! I have the following data table, in which I created a Quater-Year column for 2014 to 2019:

Knipsel1.PNG

I am creating visualisations with Quater-Year, however the axis are not sorted well (it looks like: Q1 2017, Q1 2018) but instead it should be Q1 2017 Q2 2017 and so on.

 

If I am trying to sort by another column it says that the levels between the columns must be the same:

Knipsel.PNG

However, I have no column with has similar levels to Quater-Year. What can I do to make sure I can sort right on Quater-Year? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous - You can create a new Calculated column that contains a direct match to your Quarter column:

Quarter Key = 'Date'[Year] & 'Date'[Date].[Quarter]

Sort by this new column.

Hope this helps,

Nathan

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous - You can create a new Calculated column that contains a direct match to your Quarter column:

Quarter Key = 'Date'[Year] & 'Date'[Date].[Quarter]

Sort by this new column.

Hope this helps,

Nathan

Anonymous
Not applicable

Thank you Natelpeterson!  Can you explain to me why this works? I don't really understand

Anonymous
Not applicable

Think about the column and its sorting column in a key-value pair. So, for Q1 2019, you could ask "what is the sorting value?" If there is more than one value it doesn't work. In this case you know that Jan 2019, Feb 2019 and Mar 2019 are all sequential and it should work, but the engine doesn't make any assumptions. Using 2019Q1 works because it satisfies the following requirements:

1. It is a one-for-one match.

2. The alphabetical ordering matches the sequential ordering.

Cheers,

Nathan

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.