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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
fansari
New Member

Multiple Top N Filters on 1 Matrix

Hello,

 

I am attempting to create a matrix in which both the rows (PO country) and the columns (policy country) dynamically change based on the selected filters for other columns (tier and product). I want the top 10 PO countries and the top 10 policy countries (sorted by request count) to display. However, because of the multiple topN restriction on matrix visuals, I have only been able to dynamically display the top 10 PO countries, and the top 10 policy countries are static. 

 

I created the following measure, and in a table with just the policy countries, it gives a dynamic ranking of the policy countries. However, when I try to filter only the top 10 for this measure on the matrix, all the policy countries show, not the top 10. 

 

selected policy country = CALCULATE(rankx(all(Sheet1[Policy Country]),[request count CY]),ALLSELECTED(Sheet1[Actual Program Tier]),ALLSELECTED(Sheet1[Product]))
 
Is there any workaround? Please let me know if I should provide more information.
1 REPLY 1
amitchandak
Super User
Super User

@fansari , see one of the two can help

 

TOPN with Two columns

2 column top N = CALCULATE([Net], TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[Brand], 'Item'[Category]), [Net],DESC),VALUES('Item'[Brand]), VALUES('Item'[Category]) )

 

or

 

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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