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
Anonymous
Not applicable

sorting by two rows in a matrix

Hello,

 

I can't seem to find a solution on this... assuming there is some sort of workaround that I can do (I expect that I can, but who knows).

 

My problem is that I need to sort a matrix in descending order by a number of searches, but when you expand the first row, the second row will be sorted by date descending.

 

Note: the names are marked out for privacy.

So it currently looks like this:

Collapsed:

capture2.PNG

Expanded:

capture.PNG

 

The goal is to keep it descending by 'Number of Searches', but when you expand the name, the dates will be in descending order (regardless of number):

Name Number of Searches
Name 132
 9 March, 20214
 8 March, 202160
 5 March, 202148
 4 March, 20219
 3 March, 202111
Name 80
 9 March, 202141
 4 March, 202118
 1 March, 202120
 26 February, 20211
Name 4
 5 March, 20211
 25 February, 20213

 

You can choose to sort the matrix by the 'Date' if you expand the rows that contain dates, but this puts all of the names in alphabetical order and overrides the oringal sort by 'Number of Searches'.

 

Thanks for any help that can be provided.

 

Edit: Both 'Name' and 'Date' fields are in the Rows section. There is nothing in the column section of the visual pane. 

'Number of Searches' is a measure in the values section.

I've tried sorting by an index column, grouping columns, etc., and nothing has worked so far. If anyone knows if there's a work around, it would be much appreciated.

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Do you want to sort the matrix data by the field Date descending? If yes, you can follow the steps in the below screenshot to set it. Otherwise, please provide more details about your requirement. Thank you.

yingyinr_0-1616120763637.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yiruan-msft ,

 

I want to sort both by the number of searches in descending order, and then when you click the '+' to expand a row, those dates that the searches took place would be in descending order, regardless of how many searches there were.

 

So, sort by number of searches descending when the rows are collapsed; 

sort by date descending when the rows are expanded BUT keep the sort descending by number of searches on the upper heirarchy.

 

I'd also like to add that clicking on the ellipses and then sorting by the date removes the sorting by descending number of searches.

It puts the names in alphabetical order, which isn't the goal.

 

I hope that makes sense! 

If it's not possible, I'll just try to give these results in a different way.

Hi @Anonymous ,

This may require you to make sort settings for two times:
1. When there is only one hierarchy level Name in matrix, select the More options (...) menu in the upper right corner of the matrix, then select Sort descending and select Sort by, and then select the field Number of Searches

yingyinr_2-1616665974041.png

2. When you click the "+" in front of Name to expand the data, select the More options (...) menu in the upper right corner of the matrix, then select Sort descending and select Sort by, and then select the field Date

yingyinr_0-1616665825549.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-yiruan-msft 

Apologies for the late response--it's been a busy week!

 

Unfortunately, I've tried this, and it normally overwrites the previous sort by Number of Searches.

I will try again though and let you know!

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.