How to Create Button Swapping with Parameters?

glasses and pen on paper on table

Button swapping with parameters in Tableau is a great way to add interactivity to your dashboards and make it easier for your audience to explore and understand your data. By using buttons and parameters together, you can allow users to switch between different visualizations or data sets with just a few clicks.

Keep on Reading: Tableau Data Analyst Certification Questions »

How to Do Button Swapping with Parameters in Tableau
How to Do Button Swapping with Parameters in Tableau

Desktop Specialist

Learn more about Desktop Specialist Certification.

Data Analyst

Learn more about the Data Analyst Certification.

Server Certified

Learn more about the Tableau Server Certification.

Ready to contribute to the Tableau community? Get $30 for sharing your work and certification experiences. Write and get paid for every article. Learn more »

To create a button swap in Tableau, you’ll first need to create a parameter. To do this, go to the Data pane and right-click in an empty space. Select “Create Parameter” and give your parameter a name. You can choose from a variety of data types, such as string, integer, or boolean. For this example, we’ll use a boolean parameter.

Next, you’ll need to create a calculated field that will be used to determine which visualization should be displayed. This can be done by going to the Analysis menu and selecting “Create Calculated Field”. In the calculation editor, you can use the parameter you created to create a formula that will determine which visualization to show. For example, if your parameter is called “Swap”, you can use the formula IF [Swap] THEN “Visualization 1” ELSE “Visualization 2” END

Now that you have your parameter and calculated field set up, you can create your buttons. To do this, drag a button onto your dashboard and go to the “Actions” menu. From there, you can select “Change Parameter” and choose the parameter you created earlier. Select the option “Switch” and set the value of the parameter to the opposite of its current value.

Finally, you can use the calculated field you created earlier to control which visualization is displayed. To do this, simply drag the calculated field onto the Filters shelf and set it to only show the visualization you want to display.

With this set up, you can now use the button to switch between the two visualizations and see the effect of the parameter on the visualizations. This is a simple yet powerful way to add interactivity to your dashboards and enable your audience to easily explore and understand your data.

Keep reading: Tableau Desktop Specialist Certification Questions »

Loading RSS Feed

It’s worth noting that this is just one example of how to use buttons and parameters together in Tableau, and there are many other ways you can utilize these features to create interactive and engaging dashboards.


Get our Most Popular Downloads

Download the most popular scenario-based Tableau Workbooks in .twbx format. Used by thousands of Tableau developers and job aspirants every day to improve and fine-tune their CV and Tableau Public profile. Join the largest Tableau Experts Social Group.

Tableau Banking and Financial Dataset Analysis Download
Banking & Financial Dataset Analysis

Financial Domain Tableau Dataset and Analysis. The most important domain in today’s industry. Analyze Key Performance Indicators. Discover Risky and Fraudulent Outliers. Download the Tableau Packaged (.twbx) Workbook. Includes a complete Financial dataset analysis. Enhance your Data Analytics experience with our skilled analysis.

Tableau Healthcare and Hospital Dataset Analysis Download
Healthcare & Hospital Dataset Analysis

Hospital and Healthcare Domain Tableau Dataset and Analysis. A key field of study with millions of lives at stake. The most sensitive industry today. Download the Tableau Packaged (.twbx) Workbook. Understand how healthcare datasets work. Includes a complete Healthcare dataset with analytical charts. Explore Tableau interactive features with this download.

Tableau Insurance Dataset Analysis Download
Insurance Dataset Analysis

Insurance Domain Tableau Dataset and Analysis. Important domain specific metrics and data. Learn how to visualize important metrics. Show outliers and insightful data points. Download the Tableau Packaged (.twbx) Workbook. Includes comprehensive analysis of Insurance data of a large sample population. Uses industry standard analytical practices.

Tableau Practice Test

The best Tableau practice exams built. Period. Explore definitive practical problems created by brilliant Tableau experts.

Get in Touch

Contact Us
Write for Us

Published by Rahul Bhattacharya

Rahul is a journalist with expertise in researching a variety of topics and writing engaging contents. He is also a data analyst and an expert in visualizing business scenarios using data science. Rahul is skilled in a number of programming languages and data analysis tools. When he is not busy writing, Rahul can be found somewhere in the Appalachian trails or in an ethnic restaurant in Chicago.

Leave a Reply