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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
viswaaa
Helper IV
Helper IV

Nested sorting in Matrix

Hi All,

 

I have a country column and created a bucket to sho others as separate.so created below dax.

Placed country_group and country in rows in matrix

 

Country_Group =
IF(
'Table'[Country] IN { "Other 1", "Other 2" },
"Others",
'Table'[Country]
)

 

My requirement is I need to show others always bottom though they have high profits and sort inside counties

Attached is my data and output also.

 

Please help how to get this view

viswaaa_0-1761468998784.png

 




1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

It seems like sorting by sorting by two columns in the matrix visualization shows expected result.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1761537004739.png

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

It seems like sorting by sorting by two columns in the matrix visualization shows expected result.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1761537004739.png

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Hi Jihwan,

 

I am not able to do multisort.Please help how to do this.

When I click on ohter sort is replacing

Hi,
Hmm... I think it is not a good way to do multi sorting in matrix visualization, but please check the steps below that I tried to do.

- on the report canvas,

- create new table visualization (not matrix visualization)

- insert columns ( Country group, Country, Sum of sales, Sum of profit)

- click Country group column name on the visual to sort

- And then, SHIFT + click Sum of profit column name on the visual to multi sort.

- And then, change the visual to Matrix visualization

- If one of columns are in Columns area, move it to Rows area. And then drill down to see all information.

Sorry that I could not create a short recording file to record my screen, but I hope the above helps.

Thank you.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

The moment I change my table to matirx visual my multi column sorting is not affecting .

Its removing

danextian
Super User
Super User

Hi @viswaaa 

 

Create a custom column and use it to sort country group - Sort one column by another column in Power BI 

Country_Group  Sort =
IF ( 'Table'[Country] IN { "Other 1", "Other 2" }, 1, 0 )

 You will also need to create another sort column for country but you need to do it in Power Query as referencing the column being sorted by in the sort column will return  a cyclical error. 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.