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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to sort fiscal quarters

Good morning, 

 

So I have a calendar table which includes fiscal quarters. I have names them in the following format Q1 2017, Q2 2017... 

However, when I use them in a visual I want them to sort by year before quarter - right now is sorting it left to right Q1 2017, Q1 2018, Q2 2017.... Do I need to change the names in my table to have the year first or is there another way to do this. Thanks!

 

1 ACCEPTED SOLUTION
tarunsingla
Solution Sage
Solution Sage

Creating the column with Year and Quarter (like "2018 Q4") would be ideal. But if you wish to see your data in Quarter Year format, you can use the Sort By Another Column feature of Power BI. Have both YearQuarter and QuarterYear columns and then select the QuarterYear field, go to Modeling tab, under Sort By, pick YearQuarter. That will sort QuarterYear by YearQuarter now.SortByAnotherColumn.png

View solution in original post

5 REPLIES 5
LinLinB
Advocate I
Advocate I

I always recommend creating combined date sort columns in Power Query, using Date.Start code.

For Mth-Year sorting, Date.StartofMonth([Date]) and THEN convert to a whole number

For Qtr-Year sorting, Date.StartofQuarter([Date]) and THEN convert to a whole number

 

It doesn't need to be Fiscal Year specific, that should be already built into your Fiscal Year column and FY Months and Quarters. Perfect for Independent Date Hierarchies.

v-shex-msft
Community Support
Community Support

HI @Anonymous,

 

I'd like to suggest you take a look at following link to know how to create a custom table to setup custom sort order based on 'sort by column' property:

Custom Sorting in Power BI

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
tarunsingla
Solution Sage
Solution Sage

Creating the column with Year and Quarter (like "2018 Q4") would be ideal. But if you wish to see your data in Quarter Year format, you can use the Sort By Another Column feature of Power BI. Have both YearQuarter and QuarterYear columns and then select the QuarterYear field, go to Modeling tab, under Sort By, pick YearQuarter. That will sort QuarterYear by YearQuarter now.SortByAnotherColumn.png

AlB
Super User
Super User

Hi @Anonymous

Not necessarily. You can create an additional column with the order in which you want the quarters shown and use the 'Sort by Column' feature. Or use one of the existing column for the ordering if you already have a valid one.

 

Anonymous
Not applicable

I am not sure I follow this. If I look at my calendar table it is currently sorted in the order that I would want to see but that doesn't translate to how it is presented in a visual... 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors