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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jacek_k
Frequent Visitor

Clustered bar chart - sort by year

Hi,

is it possible to sort data (quantity) descending just by year 2017 (not sum of 2016 and 2017) without adding extra columns/measures? For instance, Illinois should be above Ohio.

 

2021-01-12 11_26_39-sample sales - Power BI Desktop.png

Jacek

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @jacek_k,

Perhaps you can try to extract the field value to create a new calculated table and add sorting index to use it as custom sort order table and link to the raw table field.
Then you can use the new field to replace the raw axis on your chart, then it will apply for custom sort order on your visual graph.

Custom Sorting in Power BI 

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @jacek_k,

Perhaps you can try to extract the field value to create a new calculated table and add sorting index to use it as custom sort order table and link to the raw table field.
Then you can use the new field to replace the raw axis on your chart, then it will apply for custom sort order on your visual graph.

Custom Sorting in Power BI 

Regards,

Xiaoxin Sheng

@Anonymous Thank you very much, it works now 🙂

amitchandak
Super User
Super User

@jacek_k , You need create desc sort column and mark that as the sort column for year and then use it

 

Year 1= [year]

Year sort = Rankx(All(Table), [year],,desc)

 

Then sort Year 1 om Year sort and use it

I have discussed the same use case for Matrix - https://www.youtube.com/watch?v=KK1zu4MBb-c

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak we've misunderstood each other. I need to sort states by 2017 quantities only. Using your solution I've reordered years.

jacek_k_0-1610458874210.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors