Reputation: 105
Is it possible to do a dynamic filter in power Bi?
I want to show TOP 20 or TOP 10 or TOP 5 in columns chart. Now I have a filter with less 20 , but I need to mark in slice and show other data.
Thank in advance.
Upvotes: 1
Views: 1354
Reputation: 26
Effectively, there is no out of the box function to do TOP N. When I have to do this, I used the following method to do that
let's imagine the following table (Table1):
I add a column with this DAX formula: rang = RANKX(Table1,Table1[Sales])
And then, I add another column with TOP N Formula Top = IF(Table1[rang]<=2,"TOP2") Table in Power BI Desktop
In the report, I add a slicer based on the TOP N column Report Sample
The only thing is that the blank value still remains in the slicer. Another way to do kind of top N, is to still add a column with rank and add this column to report level filter.
Upvotes: 1
Reputation: 3798
There's no native Top N functionality in Power View visualizations. That being said, if you want to do a Top N based on a single field and measure you know in advance, you can write a measure to account for that using the pattern here.
You can vote for this feature here.
Upvotes: 1