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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
shaunwilks
Helper V
Helper V

Matrix Sorting by First Level Then Second Level

I have a scenario I thought would be easily catered for but it appears it would not.

 

I am using Matrix when has two levels. 

 

For simplicity sake lets say the levels are 

1. Transaction Header (Say the total amount of an Invoice) First Field is the "Invoice Reference Number"

2. Transaction Lines (Each of the Items sold on that Invoice) - Second Field is the "Item Code" (That I want sorted by Item Category - Not in alpha)

 

The measures may be something like Qty, Price, Tax and Net Value

 

In the table Id like the lastest Invoices shown at the top.

Therefore I highlight the "Invoice Reference" field and Sort by Column "Trans Date" and in the martix I sort by this field and set it to Descending so I get the latest invoices to the top. Tick.

 

Now within the the next level I want to show the line in Item Code order.

I highlight the Item Code Field and want to sort by the category. I can try the sort by column but it wouldnt apply in my matrix anyway.

 

As the Visual only allows the setting of order by a single field how can I manipulate the order of the fields at the Transaction line level to show in a specific order ??

 

I have tried numerous combinations and eitehr get told I cant sort the Item Codes by the field I add to set their order in the data using "Sort by Column"

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @shaunwilks 

You have two levels in the row field like

Capture14.JPG

You want to sort by level 1, then sort by level 2, right?

If so, refer to the links below:

https://community.powerbi.com/t5/Desktop/Sorting-a-matrix-second-level-sort-by-column-not-working/td...

https://community.powerbi.com/t5/Desktop/Two-level-sorting-Matrix/td-p/507259

 

Best Regards
Maggie

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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