Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
johnsauber
Frequent Visitor

Clearing Top N Visual Filter

We have a Top N filter on a visualization in our Power BI report. It seems strange to me that we can't set the N number to empty so that when published, the default is that there is no filter on top N. Beyond that, if we save this with, say N=10 and then publish it, that works fine, however, if the user clears this filter for their own purposes, it removes the field chosen in the By Value. This is a problem, from what I can tell, because in the web view where these reports are consumed, there is no way to drop the proper field into the well. Even if there were, our users wouldn't know which value to pick, as there are many they are unaware of. I could, of course, hide certain fields, but since they can see none of them, this seems unnecesssary.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@johnsauber 

I guess the best option for you is to add bookmarks for different data fields. With bookmarks, you do not clear the filter, instead you just selected corresponding bookmark and change the N value. This workaround may not convenient if you have many field you want to rank by as you need to create a bookmark for each of them.

 

Vpazhenmsft_3-1624857264483.png

Vpazhenmsft_5-1624857414865.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@johnsauber 

I guess the best option for you is to add bookmarks for different data fields. With bookmarks, you do not clear the filter, instead you just selected corresponding bookmark and change the N value. This workaround may not convenient if you have many field you want to rank by as you need to create a bookmark for each of them.

 

Vpazhenmsft_3-1624857264483.png

Vpazhenmsft_5-1624857414865.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Thanks @Anonymous !

amitchandak
Super User
Super User

@johnsauber , Not sure how are you getting and using n.

 

Say you have param for that

 

measure =

var _m = if(isfiltered(param[param]), selectedvalue(param[param]), 10 )

return

// TOPN code 

//  use _m 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thank you for your reply. I'm adding a filter bucket to the visual on the filters pane by dragging a field there. From that filter box, you can choose filter type, selecting the Top N option. If you clear the filter on the published version of the report using that little eraser button, it indeed clears the filter and there is no recovering it once this has happened because in the published report, one cannot select a field upon which to calculated the Top N: it's simply not an option. This is like a hole you can fall into, but cannot climb out of.

 

Shown in the Desktop Version

johnsauber_0-1624573052514.png

 

 

After the filter criteria has been cleared, it cannot be reset (because you can't drage a data field to the By Value area, as shown in the web screenshot below:

johnsauber_1-1624573052522.png

 

 

I recognize that you can select the option to reset all visual (below), but then this puts the Top N in the filter with some arbitrary value that must be chosen upon publication. There isn't a good way to toggle between removing the top N and adding it back without resetting your filters and views on the entire report.

 

johnsauber_2-1624573052529.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors