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
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
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