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
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/

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.

Top Solution Authors