Forum Discussion
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:
| Category | Group | Count |
| A | r | 70 |
| A | w | 24 |
| A | z | 37 |
| A | u | 16 |
| A | y | 83 |
| A | q | 32 |
| A | t | 81 |
| A | x | 45 |
| A | v | 36 |
| A | s | 94 |
| B | m | 36 |
| B | o | 45 |
| B | l | 77 |
| B | q | 28 |
| B | n | 16 |
| B | p | 29 |
| B | r | 86 |
| B | j | 10 |
| B | k | 19 |
| B | s | 57 |
| C | c | 46 |
| C | i | 51 |
| C | d | 80 |
| C | b | 83 |
| C | j | 77 |
| C | h | 34 |
| C | a | 65 |
| C | g | 59 |
| C | e | 65 |
| C | f | 42 |
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
- EdEvettsHelper II
Hi kcheyney, did you work out how to do this? I am having a similar issue myself
thanks Ed
- kcheyneyNew Member
Nope, not yet
- seenaFrequent Visitor
Dynamic filtering TopN calculated table in Power BI desktop
- seenaFrequent 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- AnonymousNot applicable
Have you figured out how to overcome this problem, seena? I have a similar problem.