top of page

Dynamic Top N Report with Tableau

a person sitting with a printed report on the table

Overview

A dynamic Top N report is a flexible, user‑driven way to highlight the highest‑performing items - such as top customers, products, regions, or indicators - based on a parameter that lets viewers choose how many items to display. Instead of hard‑coding a fixed number, you create a parameter for N, build a calculated field that ranks your dimension using functions like RANK() or INDEX(), and then filter (or highlight) the view so only items with a rank less than or equal to the selected N appear. This approach turns a static leaderboard into an interactive analytical tool, empowering stakeholders to explore performance at different levels of granularity, compare patterns across categories, and uncover insights that would otherwise remain hidden in a long list of values.

Step-by-Step Guide

Using the Sample-Superstore data set, let’s create a dynamic top N report that allows users to explore Sales performance by State.

  • Create a view showing State by Sales.

  • Sort the view in Descending order by Sales.

  • Create a new calculation “Rank” containing the function INDEX() and add it to the view – to display the position of each State.

a bar chart

Create a Parameter “Top N” as follows.

creating parameter in tableau

Create a calculation linking the parameter and the Rank calculation. This calculation will be used in filtering or highlighting the top N States.

a tableau calculation

Add the above calculation to the color shelf to create the view below.

a bar chart highlighting the top 5 states by sales

Customizing the Title

Compute Top N Sales.

To do so, create a set that contains the Top N States as follows.

creating a set in tableau

Configure the set using the Top N Parameter as follows.

configuring the set to compute the top N sales

Compute the Top N Sales as shown below.

a calculation computing the top N sales

Compute the Percent of Total as shown below.

a tableau calculation computing the percent of total sales

Drag the Top N Sales and %ofTotal Sales calculations to the detail shelf. Ensure you format the Percent calculation into percentage.

Edit your title and customize it as follows.

customizing the chart title to add more context on the analysis

See the resulting top N report.

a gif showcasing the top N report in Tableau

Conclusion

A dynamic Top N report transforms a standard Tableau view into an adaptable, insight‑driven experience, giving users the freedom to explore performance at the level that matters most to them. By combining parameters, ranking logic, and thoughtful filtering or highlighting, you create a tool that not only highlights key performers but also encourages deeper investigation across categories and time periods. This approach ultimately strengthens decision‑making by surfacing patterns that static reports often obscure, and it reinforces the value of designing dashboards that respond to real analytical questions rather than locking users into a single perspective.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

WhatsApp: +254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page