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
hcze
Helper II
Helper II

Sort matrix column header

Hi all,

First of all, my apology since I have seen the same question had been posted numerous times and all answers are leading to creating new index/sort column, however I cannot seem to replicate the result for whatever reasons.

 

Here I have a simple table with year and index columns and all I wanted to do is just to sort the year descending.

 

Help appreciated.

 

Hcze

 

SortColumnMatrix.pbix 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@hcze 

You just have to tell PowerBI to sort your year column by your index column:

 

2020-06-26_19-22-10.gif

View solution in original post

4 REPLIES 4
Vmpbi
Frequent Visitor

Thanks for sharing… check out the links below. It provides a comprehensive guide on how to sort measures as columns

in a matrix visual.

https://insurancedatainsights.blog/2024/04/27/dax-topn-brokers-and-others/

Unlock Dynamic Data Display In Your Power BI Matrix

amitchandak
Super User
Super User

@hcze , On Matrix column there is not sorting available. It means your default sorting will stay. And that is Ascending. The way to do is create a Year Desc Rank Like this

 

Assume you have Year column in date table

Year = Year([Date]) // Similar formula -- This is column you alredy have

Year1 = Year([Date]) // new column to avoid circular depndencies

Year Rank = Rankx(All(Date),[Year1],,Desc,Dense) // Desc sort

Mark Year Rank sort column of Year.

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
jdbuchanan71
Super User
Super User

@hcze 

You just have to tell PowerBI to sort your year column by your index column:

 

2020-06-26_19-22-10.gif

Thank you so much! I was under impression that the sorting applied to the whole table but apparently not. I have to click on Year column and sort by Index rather than click on Index column and sort by Index.

The gif is a nice touch and shows small details which otherwise missed!

 

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