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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.