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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Ranking and filtering top 10 with multiple rows in Power BI Matrix

Dear BI community,

 

In the below Power BI Matrix (filters applied: fiscal year is 2020-21 and supplier is supplierX), I have 2 rows being firstly Area of Law (12 of these), and Matter Name(hundreds of these). In the values I have client name, matter start date, and total invoiced amount. What I am trying to do is filter out to the top ten matters by total amount invoiced under each area of law (highlighted in sky blue). I thought I could achieve this by creating a rankx measure but it is not working as I expected. How can I proceed so that each area of law section has only the top ten matters invoiced within each area of law? I also do not have access to the advanced filter where I can filter by N on the values.

 

Please let me know, thank you for your help.

 

AndrewPanchal_0-1641963668903.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Assumed Total Amount Invoiced is a measure. Try a measure like and filter for <=10


Rankx(filter(summarize(allselected(Table), Table[Area of Law], Table[Client Name]), [Area of Law] = max([Area of Law]) ), [Total Amount Invoiced],,desc, dense)

 

or refer

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Assumed Total Amount Invoiced is a measure. Try a measure like and filter for <=10


Rankx(filter(summarize(allselected(Table), Table[Area of Law], Table[Client Name]), [Area of Law] = max([Area of Law]) ), [Total Amount Invoiced],,desc, dense)

 

or refer

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thank you very much Amit. I referred to your link and was able to make the code to solve this issue perfectly. Sincerely appreciated.

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!

December 2024

A Year in Review - December 2024

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