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
Krcmajster
Helper IV
Helper IV

Sort Matrix table based on row that is not on top

I have a matrix visual that contains ID,Region,Country,City as rows (to get the Freeze columns effect of Excel). This is the order client wants. However he wants matrix to be sorted by city, which currently does not work if I Sort by it. If I move the City to top of the rows then it is fine. 
Is there a way to sort the visual based on other values that are in the row?  I need to use matrix visual because I can't mimic freeze columns from excel with simple table visual 

1 ACCEPTED SOLUTION

Hi @Krcmajster 

Matrix visual currently could only be sort by the first row.

So sort by City column makes no sense when your City column is not the the first column in matrix row.

You can try my way, sort your ID column by City column and then sort your matrix by ID.

Your ID column is the first row, it will work.

My Sample:

1.png

Select ID in Fields and sort ID by City in Column Tools.

2.png

Build a Matrix.

5.png

Sort Matrix by ID and select des/asc.

3.png4.png

The Matrix will show the result sorting by City.

 

Best Regards,

Rico Zhou

 

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

 

View solution in original post

5 REPLIES 5
PC2790
Community Champion
Community Champion

Hello @Krcmajster,

 

So if I understand correctly, you have City as your subcategory in sequence as ID --> Region -->Country -->City

So when you are trying to do a sort by -->City in the matrix settings, is it not working?

Something like this: 

PC2790_0-1614162367928.png

 

I don't have the option as you but I am assuming I need to create a hierarchy and add it to Rows to get the Category and subcategory?

Capture.PNG

No heirarchy is needed as such.

PC2790_0-1614166946399.png

 

If you can share your pbix file removing the sensitive data, I can take a look

@PC2790 Unfortunately I can't do that. But based on what you mentioned it is strange that it is not sorted. On the screenshots below you can see that I am doing the same thing, but the order is the same no matter if I select asc or desc

Capture.PNG

 

 

 

 

 

 

 

Capture3.PNGCapture2.PNG

 

 

 

 

Hi @Krcmajster 

Matrix visual currently could only be sort by the first row.

So sort by City column makes no sense when your City column is not the the first column in matrix row.

You can try my way, sort your ID column by City column and then sort your matrix by ID.

Your ID column is the first row, it will work.

My Sample:

1.png

Select ID in Fields and sort ID by City in Column Tools.

2.png

Build a Matrix.

5.png

Sort Matrix by ID and select des/asc.

3.png4.png

The Matrix will show the result sorting by City.

 

Best Regards,

Rico Zhou

 

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

 

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.