cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Sort matrix

Hi all, hope someone can help me with below.

I have a matrix with two rows: risks and departments.

I would like to sort the average column (as what you see below), but would like to keep the order of first column with: 1. Risk, 2. Risk and 3. Risk. Average column & trend are measures.

Incorrect:

 Risks Average Trend 2. Risk a Department 1 65.4 1.3 b Department 2 71.8 10.5 1. Risk a Department 1 57.5 -0.1 b Department 2 63.5 1.5 c Department 5 64.3 5.3 d Department 6 71.4 3.4 e Department 3 77.0 0.6 f Department 4 87.6 -0.5 3. Risk a Department 1 78.3 1.9 b Department 3 81.3 5.5 c Department 4 82.8 2.2 d Department 2 88.0 1.7

It should be like:

 Risks Average Trend 1. Risk a Department 1 57.5 -0.1 b Department 2 63.5 1.5 c Department 5 64.3 5.3 d Department 6 71.4 3.4 e Department 3 77.0 0.6 f Department 4 87.6 -0.5 2. Risk a Department 1 65.4 1.3 b Department 2 71.8 10.5 3. Risk a Department 1 78.3 1.9 b Department 3 81.3 5.5 c Department 4 82.8 2.2 d Department 2 88.0 1.7

Hope someone can help me! Have a nice day 🙂

4 REPLIES 4
Super User

You try by creating a temp table by taking unique value from risk column.
I have used sample data where i have once column call family.

and temp table is

by specifiying the other in which you want to sort the column.

Now in you table create a new columns: using this:

Column = RELATED('Table'[Index])

Now once you create the matrix visual
step 1 click on Risk column
step 2 click on Sort by colum
Step 3 as per the aces or desc it will be sortet
See below visual
initallly i had family_1 at first place but after sort it looks like this

you can also follow this video for custom sort: https://youtu.be/PUaFtLpIMvY?si=n4pkXmw984_LSByi

Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: https://www.youtube.com/@letssolveproblem

Regards

Frequent Visitor

Hey! Thanks for explaining, but I think I was not clear.

Now I can sort on ''Risks'' to see below.

 Risks Average 1. Riskname 74.6 61.1 82.4 62.2 61.6 61.4 2. Riskname 60.8 68.1 3. Riskname 84.7 76.2 81.3 73.6

And I can sort on Average, and below is what I got:

 Risks Average 2. Riskname 60.8 68.1 1. Riskname 61.1 61.4 61.6 62.2 74.6 82.4 3. Riskname 73.6 76.2 81.3 84.7

Now, the problem is that I would like to sort on ''Average'' from low to high, but the risks should be in order of 1-2-3. The outcome should be like this:

 Risks Average 1. Riskname 61.1 61.4 61.6 62.2 74.6 82.4 2. Riskname 60.8 68.1 3. Riskname 73.6 76.2 81.3 84.7

I tried your solution, but it seems like it doesn't work 😞 Or should it work?

Super User

I tried of the post on commnuinity it worked for me, but for that you may need to convert your matrix to table view which i am not sure acceptable to you. Here is link for the solution on commnunity: https://community.fabric.microsoft.com/t5/Desktop/Order-multiple-columns-in-a-matrix/m-p/135815

It worked for me here is the Schreen shot:

If it works for please accpt the solution, other will be benifited by this

Regards

Frequent Visitor

Thats unfortunately not possible for us, we need the matrix, because I have 2 different rows..

one with:

1. Risk

2. Risk

3. Risk

And within each risk, there are different risknames (other column)..

If this is not possible, than I have to deal with it haha.
I don't want to have multiple names in the table.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors