Forum Discussion

kcheyney's avatar
kcheyney
New Member
10 years ago

Dynamic filtering TopN calculated table in Power BI desktop

Hi I have a table that has a Category and a Group and some numeric measure (called count for this example).  I want to be able to create a filter on category and use it to filter a calculated table that returns the Top N for the count field.  Here is my example table:

CategoryGroupCount
Ar70
Aw24
Az37
Au16
Ay83
Aq32
At81
Ax45
Av36
As94
Bm36
Bo45
Bl77
Bq28
Bn16
Bp29
Br86
Bj10
Bk19
Bs57
Cc46
Ci51
Cd80
Cb83
Cj77
Ch34
Ca65
Cg59
Ce65
Cf42

 

I want to create Filter on my report for Category and then have it cross filter a table or chart on the report that shows the Top N (in this example 5) Groups by Count. as shown in the two pictures below (filtered on A and then on C)  I am very new to DAX and haven't figured out how to do this.  Any help would be greatly appreciated!

 

Top 5 filtered on category ATop 5 filtered on category C

 

 

 

 

7 Replies

  • Hi kcheyney, did you work out how to do this? I am having a similar issue myself

     

    thanks Ed

  • seena's avatar
    seena
    Frequent Visitor

    Dynamic filtering TopN calculated table in Power BI desktop

    • seena's avatar
      seena
      Frequent Visitor

      me too. I have a similar request from my customer. Struggling to get the numbers correct
      That will work if you put a visual filter to select the TOPN however, it does not work if you want the TOPN to be dynamic

      • Anonymous's avatar
        Anonymous
        Not applicable

        Have you figured out how to overcome this problem, seena? I have a similar problem.