Tableau | Dynamic Pagination | A Step-by-Step Guide

Vaishnavi Kousalyanandan
4 min readMar 2, 2022

Recently in few of my projects, I found dynamic pagination to be a very useful feature when showing a long list of data either vertically or horizontally. It helped me show the complete data without having to compromise on the data shown by filtering/leaving out information to make the data fit the screen. Hence thought of sharing it as this might help you to create visually appealing tables even with a long list of data.

Note: The dynamic pagination is not restricted to tables and it can be applied to any chart type like a stacked bar, bar charts, etc.,

Dynamic Pagination in Tableau
Dynamic pagination in tableau

How is this different from simple pagination using a parameter in tableau?

Let’s taken an example. Say, you have Region as a filter and you are showing the list of countries in the dashboard. Say you wanted to show only 20 countries per page and hence there will be 5 pages in total for all regions and you have navigated to the 5th page. But now when you select a particular region which has just 10 items from the 5th page the dashboard goes blank because there is no fifth page for the chosen region as it has only one page in total.To show the data in that one page , the user has to go to first page. To avoid the dashboard going blank everytime which is not a good user experience, I have created a dynamic pagination in tableau which changes according to filters selected in the dashboard.

What are the calculations required to create dynamic pagination?

  1. An integer parameter with page numbers as input.
  2. A calculated field to compute page number for every item.
  3. A calculated field to compute the total number of pages.
  4. A calculated field for showing the starting page number.
  5. A calculated field to display the page number and total pages.
  6. 4 calculated fields for navigation buttons.
  7. A calculated field to filter the list based on the page number.
  8. 5 sheets for designing the buttons and display text.
  9. 4 parameter actions to change the parameter values.

How to create dynamic pagination?

Step 1: Create an integer parameter with a range starting from 1 to the total number of pages your dashboard might have. On the safer side let's give a higher number say 5000.

Step 2: Create a calculated field to compute the page numbers for every item in your list. The denominator highlighted below tells the number of items that need to be shown on each page. This can be changed as per your requirement.

Step 3: Create a calculated field to calculate the total number of pages the dashboard has based on the filters selected.

Step 4: Create a calculated field to display the starting page number in the display text box.

Step 5: Create a calculated field to show the text that displays the page to which the user has navigated and the total number of pages in that window.

Step 6: Create the calculated fields for navigation buttons as shown below:

Step 7: Then create a calculated field to filter the list based on page number and place the field in the required sheet and select TRUE.

Step 8: Create 5 sheets to display the buttons and text in the dashboard. Arrange them accordingly in the dashboard.

Note: You can also design the buttons in whichever way you want.

Step 9: Create parameter actions in the dashboard to change the page number based on the user’s navigation.

That's it! Though it seems like there are a lot of steps to be followed but once implemented it provides a very good user experience when dealing with long lists of data.

Thanks for reading! Refer to the workbook published here if you face any issues in implementing the feature.

I hope you find this tutorial useful and let me know any concept/feature that you would like me to write about in the comments below.

--

--

Vaishnavi Kousalyanandan

Data Engineer @ PayPal | Data Analytics 🔍 | Data Visualization 📈 | Tableau 📊