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
SDigital007
New Member

Multi-tiered Custom Sort as in Excel

Re-posting since the original request was marked complete even though it wasn't.

 

I use Power BI to create invoices for our clients. I need the ability to sort my entire table at 3 different levels - using 3 columns as in Excel: Column 1: Customer Id from A to Z, Column 2: Products by Supplier A-Z, Column 6: Prices from high to low. Currently Power BI only allows sorting at one level at a time. Sorting at the second level scrambles the 1st, undoing the order of customer IDs.

What I am looking for is a way to sort by level: 1st customer ID, then for each customer ID, sort by product type, then for each product type, sort by price. The end goal is to create line items for customer invoices.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi there.

 

I myself have not familiarized myself with multi-level sorting in Power BI, but I believe you can do it.

 

In the Power Query editor, click the drop down next to the first column you want to sort. You can then repeat this for the second and third level columns.

 

Your applied step will look something like this:

= Table.Sort(#"Multi-level Sort",{{"Customer ID", Order.Ascending}, {"Products by Supplier", Order.Ascending}, {"Prices", Order.Ascending}})

Hope this helps!

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi there.

 

I myself have not familiarized myself with multi-level sorting in Power BI, but I believe you can do it.

 

In the Power Query editor, click the drop down next to the first column you want to sort. You can then repeat this for the second and third level columns.

 

Your applied step will look something like this:

= Table.Sort(#"Multi-level Sort",{{"Customer ID", Order.Ascending}, {"Products by Supplier", Order.Ascending}, {"Prices", Order.Ascending}})

Hope this helps!

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.