Tableau Tip: Top and Bottom with Index

Vignesh Suresh
Sep 24, 2023

You might have seen Top 10 and Bottom 10 with Sets. To show both of them together, we use a Combined Set. In this tutorial, I will be showing the Top and Bottom with Index Table Calculation.

Create a Bar chart. Drag Sales to Columns and Sub-Category to Rows. Sort the Bar in Descending Order and Drag Sales to Labels.

Create a Calculation Top and Bottom and write the calculation as shown below

IF INDEX()<=5 THEN 'Top 5'
ELSEIF INDEX()>=WINDOW_MAX(INDEX())-4 THEN 'Bottom 5'
ELSE 'None'
END

Drag this Calculation to Color. Set the Top as Green, Bottom as Red, and None as Grey.

Thank you for reading. Connect with me on Twitter and LinkedIn, and check out my Tableau Public profile for more visualizations.

Vignesh Suresh

--

--