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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
adityah
Frequent Visitor

Custom Sort for PBI matrix rows

Hi Guys,

Posting this here since none of the previus solutions seem to be working. I have a power bi matrix which looks like this:

 

Sub Class Code20222023
CAO11
CAT22
CFF33
CJA44
CJI55
CJO66
CMA77
CMI88
CMS99
CMT1010
CPC1111
O1212

 

I'm trying to rearrange the matrix row as

 

Sub Class Code20222023
CAO11
CAT22
CFF33
CJO66
CJA44
CJI55
CPC1111
CMA77
CMS99
CMT1010
CMI88
O1212

 

I tried creating a new table with sort order column and linking it through sub class code. It still doesn't sort according to sort order column. I'm not sure if anyone has a workaround?

1 ACCEPTED SOLUTION

1. add a sort column

lbendlin_0-1732283763031.png

2. bring your data into a usable format by unpivoting

lbendlin_1-1732283799887.png

3. use the "sort a column by another colum"  function to sort the Sub Class Code by the Sort column.

lbendlin_2-1732285154603.png

4. Render the data in a matrix visual

 

lbendlin_3-1732285204230.png

 

 

 

 

View solution in original post

8 REPLIES 8
Prasanthke
Frequent Visitor

Could you please explain on what basis you trying to sort the sub class

Its a custom sort order that is required. The report user wants to see his rows in this order as mentioned in the question.

lbendlin
Super User
Super User

You want to change the sub class order but keep the value sort?  How would that work?

edited

1. add a sort column

lbendlin_0-1732283763031.png

2. bring your data into a usable format by unpivoting

lbendlin_1-1732283799887.png

3. use the "sort a column by another colum"  function to sort the Sub Class Code by the Sort column.

lbendlin_2-1732285154603.png

4. Render the data in a matrix visual

 

lbendlin_3-1732285204230.png

 

 

 

 

The problem is, the moment I remove the sort column from the visual, it reverts to alphabetical sorting of sub class code

Anonymous
Not applicable

Hi @adityah ,

 

Please check if you are using sort by column correctly, I have made simple sample, you can check the attachment.

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

cannot reproduce.  You need to use the menu item as indicated.

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.