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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Chateauunoirr
Advocate I
Advocate I

How to sort account names within fixed category order in matrix visual?

Hello everyone,

I could use some help with a sorting issue in Power BI.

I have three tables structured as follows:

Capture d'écran 2025-07-18 120906.png

In my matrix visual, I’ve placed:

  • Rows: Category NameAccount Name

  • Values: Sum of Price, Sum of Time Spent

I’ve already sorted the Category Name column in the Categories table using the Category Rank column, which gives me the desired order:

“Big Buyers”, “Medium Buyers”, “Small Buyers”

However, when I try to sort the matrix by Price or Time Spent, the sorting affects the Category Name level as well — it reorders the categories depending on the measure.

What I’d like instead is to keep the categories in the fixed order defined by Category Rank, and only sort the Account Names within each category based on the selected measure (Price or Time Spent).

Is there a way to achieve this behavior in the matrix visual?

Thank you in advance for your help!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Chateauunoirr 

 

That’s exactly how the matrix visual works — you can sort by either the row category or the measure, but not both at the same time. I covered a workaround for this in my vlog: https://youtu.be/FWlDFVNis08

Just a heads-up: it can be a bit finicky and might not be ideal for beginners or anyone looking for a quick fix.

 





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.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @Chateauunoirr 

 

That’s exactly how the matrix visual works — you can sort by either the row category or the measure, but not both at the same time. I covered a workaround for this in my vlog: https://youtu.be/FWlDFVNis08

Just a heads-up: it can be a bit finicky and might not be ideal for beginners or anyone looking for a quick fix.

 





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.

Hi @danextian 
Thanks for the solution

The solution does take time to implement, but it's still a superb video solution. I'll need to sit down and understand this.

Can we apply the logic to two fields at the same time by assigning a rank to two columns? It seems a bit complex to me, but I wanted to get your opinion.

Hi @Chateauunoirr 

If the columns are form the same table, you can use

ALL ( 'dimTable'[column1], 'dimTable'[column2] )

danextian_0-1752903283463.png

 





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.
FBergamaschi
Solution Sage
Solution Sage

As far as I know it is not possible as of today

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

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.