Showing All Values when Top N Filter Results In Less Than N Values

Published: 22 Feb 2013
Last Modified Date: 20 Jul 2023


When you apply a Top N filter to a view that uses a second filter, the updated view does not produce the expected Top N result.

For example, in Superstore Sample data, you have a filter on Sub-Category showing Top 5 by Sales, and then filter by Region. The same 5 subcategories will display regardless of which region is selected.


Tableau Desktop


Option 1: Add the Second Filter to Context

On the Filters shelf, right-click the second filter, and then select  Add to Context. In the Superstore example above, you would add Region to context. For more information, see Creating Context Filters in Tableau Help.

Option 2: Use INDEX() and a Table Calculation

Follow the instructions in the Finding the Top N Within a Category article to use INDEX() as a top N filter.

Additional Information

To view Option 1 in action, see the video below.
Note: the video has no sound

Did this article resolve the issue?