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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ShoaibAhmed
Frequent Visitor

Matrix Multiple column sorting

Hi Power BI Community,

 

I am new to Power BI and would like to sort Matrix Coloumn as we do in excel Pivots. I have tried, but i cannot figure out how to fix it.

 

I want the multiple sorting as follows:

1) Chronological order Date - Ascending order

2) Beneficiary by Sum of Amount in each date - Descending order [The Beneficiary can come on any date and multiple times in a month]

3) Purpose by Amount in each beneficiary - Descending order

 

The result should be as follows:

Capture.PNG

4 REPLIES 4
smeadows
New Member

I know this is an old post but I believe the accepted "solution" is incorrect (in the sense that you can achieve the desired outcome but not via a specific setting).

 

I have verified that this can be accomplished partially in a similar way to Pivot Tables in Excel*.  In short, you must add the Row field(s) you want to sort by in order (typically from "inner" i.e. most detailed value to "outer" i.e. least detailed category).  You have to sort the "Rows" column in the visualization after each row field entry.  In the OP Example: 1) You would first add ONLY the Row Field = "Purpose" and then sort the "Rows" column in the desired order. 2) You would then add the "Beneficiary" row field and again sort the "Rows" column in the desired order (the "Purpose" field will remain sorted in the originally selected sort order. 3) You would then add the "Date" row field and again sort the "Rows" column in the desired order (the "Purpose" and "Beneficiary" fields will remain sorted in the originally selected sort order(s). and so on.

 

I have tested this on PBI Desktop "Version: 2.121.644.0 64-bit (September, 2023)".

 

*In Excel, you can programatically set the sort order of the Pivot table matrix row columns via VBA - through which you have full control of the visual.

V-lianl-msft
Community Support
Community Support

Hi @ShoaibAhmed ,

 

Please refer to these as alternatives:

https://community.powerbi.com/t5/Desktop/Sorting-by-multiple-columns/td-p/535690 

https://community.powerbi.com/t5/Desktop/Matrix-multiple-Sort-columns/td-p/523938 

There is no the same visual in pbi desktop for the time being

 

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

ShoaibAhmed
Frequent Visitor

Thanks @amitchandak.

but is there any other visual which can give the above result.

amitchandak
Super User
Super User

@ShoaibAhmed , Multiple sorting is not supported on matrix. You can sort on row item or values item and rest of the sorting will adjust automatically

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.