Forum Discussion
Power BI: Dynamic Top N Filtering Based on Selection?
- Anonymous1 year ago
Hi adi38612 ,
According to your question, you want to filter the first table (e.g. name) and then sort based on the values filtered by the first table right?
We can first use the RANKX function on the name column and total column sorting, and then create a new Topn table to Topn table to filter you need the first few rankings, and finally write a measure to put into each chart to achieve your needs!Name ID Count = CALCULATE(COUNT('Table'[ID]), ALLEXCEPT('Table', 'Table'[Name]))Rankx Name = RANKX(ALLSELECTED('Table'[Name]),[Name ID Count],,DESC,Dense)Top N = GENERATESERIES(1, 10, 1)Top N Names = IF([Rankx Name] <=SELECTEDVALUE('Top N'[Top N]), 1, 0)If you have any other questions, you can check out the pbix file I uploaded, I hope it helps, and I'd be honored if I could solve your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Anonymous, It worked like a charm.
Quick update: the 'Filter' interactions between the two visuals should be enabled, both ways!