Filter dynamic in power bi

1.3k Views Asked by At

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.

2

There are 2 best solutions below

0
Franck Mercier On BEST ANSWER

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.

0
greggyb On

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.