Why isn't my top N filter working properly?

We all once had no idea what a parameter was and how to use them to be a dynamic top N filter (right guys?). And after we grasped the concept and heading straight towards our Tableau dashboards and wanted to try it out. After adding all the configuration into the worksheet, filtering, formatting and action and stuff. You might wonder why the top N filter is not working while you have other filter on?

You can see from the screen capture above there are obviously less than 10 customers even we have the top 10 customers filters. Why is that? Can't Tableau even count to 10? Well that's not true, it is because we need to make the "Region" filter as Context Filter.

What is a context filter?

So basically Tableau filters are computed independently by default, which means each filter accesses all rows without regard to other filters. BUT, a context filter is different it can:

  • Force a filter to be carried out first
  • Create a dependent numerical or top N filter. You can set a context filter to include only the data of interest, and then set a numerical or a top N filter

Okay so it would instruct Tableau to compute based on the context first before it goes to other non-context filter. In this case, we will need to add the Region field into context so Tableau knows it needs to compute the top N after the specific region we want to look at.

But how?

You only need to right-click the filter you want to make it into context filter. And they will turn grey (see below). There you have it! You can add other filters into context as well.

So this is it! Next time when you are going to create multiple filters with a top N filter. Make sure to add other filters into context, so you won't lost the exact N number you specify for Tableau.

Author:
Alfred Chan
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab