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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AlexS2023
Helper I
Helper I

Matrix how to Sort within Nested Rows?

Hi all,

 

I have a matrix showing how many employees we've assigned to a given "cost center" by date, with additional rows to show the employee names. This worked great, but now I've been asked to include the Employee's Job-Title too, which is proving trickier than it sounds...

 

If I just add Job-Title to the rows, I get a third level of nested data, which is not helpful at all, but I can't add it to the columns because that then repeats the timeline for every possible job-title!

 

So, I created a custom column to show the Job-Title next to the Employee name (as if it was a second column in the Y axis - see screenshot). This moved me in the right direction, but leaves two Questions:

 

1. The records are sorted alphabetical by Employee Name, it would be much more useful to sort by Job-Title. Is there a way I can do this? I *could* just swap the name for the job-titles in the custom column (which would be an acceptable compromise) except...

 

2. I need to add a slicer, so managers can filter the employees by job-title. I figure this means I *have* to get the actual job-title into the matrix somewhere, but I don't want it to be visible. is there anyway to add the data without screwing with anything else?

 

Open to all ideas and workarounds 🙂

 

TIA

ASpbi shot1.jpg

 

2 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

For point 1 - I agree, just swap it.

For point 2 - you can have a slicer on the canvas or put the field in teh filter pane that only has the job title and the user can use that to filter to what they want - it doesn't need to be part of the matrix visual. Another option if you would prefer to keep name and title separate it to simply turn off the stepped layout under the Rows settings.





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

Proud to be a Super User!





View solution in original post

Hi! You absolutely can, depending on what it is you want to sort. For example, if you want to sort title in a non-alphabetical way, you can assign each item a numerical value in the order you want, then sort the title by the numeric value - this way when you use Title, it is sorted in the order you assigned without having to have the numeric value actually in the visual (this is also the same way you would have month name sorted correctly by chronology, not alphabetically). Sort one column by another column in Power BI - Power BI | Microsoft Learn





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

Proud to be a Super User!





View solution in original post

3 REPLIES 3
audreygerred
Super User
Super User

For point 1 - I agree, just swap it.

For point 2 - you can have a slicer on the canvas or put the field in teh filter pane that only has the job title and the user can use that to filter to what they want - it doesn't need to be part of the matrix visual. Another option if you would prefer to keep name and title separate it to simply turn off the stepped layout under the Rows settings.





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

Proud to be a Super User!





Thanks AudreyGerred. I was clearly overthinking this one.

 

Just on point 1, do you think there would be a method (to sort by a hidden field)? I know I can live without it - but I can already here my manager asking anyway 😂

Thanks,

Hi! You absolutely can, depending on what it is you want to sort. For example, if you want to sort title in a non-alphabetical way, you can assign each item a numerical value in the order you want, then sort the title by the numeric value - this way when you use Title, it is sorted in the order you assigned without having to have the numeric value actually in the visual (this is also the same way you would have month name sorted correctly by chronology, not alphabetically). Sort one column by another column in Power BI - Power BI | Microsoft Learn





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

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.