top of page
Bernard K

Using parameter to swap between different visualizations (e.g. between bar and area chart)

Updated: May 22, 2021


Using parameter to swap between different visualizations

In one of the previous articles in this platform, I showed you how to swap between views using a parameter and a layout container. This approach was a little bit a process and required us to create a dashboard to materialize that.

In this article, I would like us to take a different approach – whereby instead of using parameter, layout container and dashboard layout. We are going to use a parameter and a calculated field to enable viz swapping within the worksheet level. For this case we are going to create a view in which users can swap between a bar chart view and an area chart view.

Create a parameter.

Create a string parameter ‘Select chart type’.

Creating parameter in Tableau

Create the first view – a bar chart.

To create the first view, lets create the calculation ‘Bar chart view’.

Create the view by dragging Sub-category to the columns and the calculation ‘Bar chart view’ to the rows. Choose Bar chart under the marks card.

Create the second view – an area chart.

To do that create the calculation ‘Area chart view’ as shown below.

Drag this calculation to the view, make the chart dual axis and synchronize the axis.

Under marks card of the second view – ‘Area chart view’, choose ‘Area chart’.

Show the parameter control and select ‘Area’.

Note now the view can change from Bar to Area chart and vice-versa based on your selection on the parameter control.

In a nutshell, that is the second way you can swap between different visualizations using a parameter and a calculated field.

I hope this article was somewhat helpful to you. To receive more of the Tableau tips and tricks, kindly join our mailing list by subscribing below.

Thank you for reading.

Comentarios


Blog.png
Black & white.jpg

About Me

More About the Author

Bernard K

Analytics Consultant | 3X Tableau Certified

Bernard is a data analytics consultant helping businesses reveal the true power of their data and bring clarity to their reporting dashboards. He loves building things and sharing knowledge on how to build dashboards that drive better outcomes.

Let’s discuss your data challenges! Let’s work together!

bottom of page