One of the things I like most about using Tableau is experimenting with different types of visualizations. But what if the people who are viewing my dashboard want to be able to switch between different types of charts and graphs as well? Here are several different ways of accomplishing that.

1. Switching between a Bar Chart and a Line Chart

This is a fairly simple trick that is detailed much more eloquently by Andy Kriebel here. Create a parameter that has two options, either a bar chart or a line chart. Then create two calculated fields, one for each value. They are the same calculated field, but the beginning is a little different for each one. The bar chart option reads "if[Parameter]="Bar" then [Profit] else null end". The line chart option reads "if[Parameter]="Line" then [Profit] else null end.

To finish the job, place these together as a dual axis chart, then make sure to select a "Line" visualization type for the Line calculation on the Marks card. Since each of the calculated fields will have a null value when the parameter is on the other choice, one of them will always be null. For the finishing touch, synchronize axes.

2. Showing Sub-Category on Demand

If an end user wants to drill into a hierarchy with many values in Tableau, the query can create a visualization that is too large to view in one viz. This trick makes it possible to drill into a secondary dimension, but only on selected values.

First create a parameter that has the values of the first level category or dimension in your hierarchy. Then create a very simple calculated field to replace your second level category/dimension: "if[Parameter]=[Category] then [Sub-Category] else "" end".

After replacing the original sub-category field on the view with the new calculated field, only the selected input category will show sub-category.

3. Switching between Different Visualizations on a Dashboard

What if my colleague wants to switch between a map and a bar chart on a dashboard? Well, the endlessly innovative Alan Smithee found a great way of doing just that. Simply create a parameter that has the input of either a bar chart or a map. Then create a calculated field to filter out whichever view isn't selected in the parameter—something like: "if[Parameter]="Bar" then 1 else 0". Then repeat the opposite for the second visualization, and filter on each view so that only values of 1 are visible.

Now add each visualization to a dashboard container, hide the titles, and make sure the parameter is available. Switching between views becomes just a flick of a switch.

Here's a more detailed explanation of the tips:


Thank you so much for the insight! I continue to be amazed on what Tableau can do and wish I could use this everyday!

Very Nice. Thank you.

Nice one.

Great video. In first example we can add parameter next to Y axis so when we switch parameter so name of Y axis can also change :)

Love this! Not only functional but easy. Keep up the good work!

nice tip. Any reason the javascript viz wasn't placed into post so we can play with it (rather than a screencap)?

Ross, you rock. Thanks for consolidating 3 very useful applications of parameters in a viewing of less than 10 mins!

Great! Loved this video!

Very cool Ross. Is there a way to 'Show subcategory on demand' if you are using groups? I've grouped some records together to make a simple view for end users. But it would be cool to allow them to easily expand on that group without having to drill down into the underlying data.

Really helpful. :) Thank You.

Extremely clever! This can actually be applicable to many other types of tools as well!
Thank you! =)

good stuff to do more dynamic actions.... amazing tricks

good stuff to do more dynamic actions.... amazing tricks

Thanks for the tips, useful stuff, am about to get to applying them

Really very Nice but i have one question.

Under first trick bar/Line it is showing some null on right bottom corner. How to manage those values if i am using this tricks.

I think you can right click on the null that is showing and select hide indicator. That should remove it from showing :)

Very helpful! Thank you for the post

This is really helpful and awesome. Thank you, Ross!!

Great tips - thx for sharing!

This is really awesome!
But is there possible for us to use chart instead of parameter?
For example, by hovering around the map, it will show respective country's sales performance but it will show overall details (like sales and profit of all countries) when no country is selected.

Dashboard -> Actions -> Add filter -> Filter... -> Choose hover and choose leave the filter option

thank you for sharing this is awesome information

Changing chart type on fly is good idea. But can I have more than 2 choices? Because we are using Dual Axis feature here - but I want to have support more than 2 chart types (Line, Bar and Bubble).

I can think of creating more than 3 sheets and managing hide/show sheet based on parameter selection.

But the idea you gave is nice - that way I don't duplicate my sheets.


Hi, when I do the third example parameter of bar/map. I replicate the same on my end but when i go to my dashboard and select let's say second value of map, my map shows much lower (where i placed it in the dashboard). How do i get it to take up the spot of the bar? I watched the video many times but don't understand what I am doing differently.. Thanks

Choose the horizontal or vertical object before the dragging the sheets, it will solve your problem.

Hi - Thanks for this. However when I am selecting the other visualization types in parameter control which is not the chart type of of my active worksheet, instead of showing Null values it gives me an error as "An error occured while communicating with the data source". I am using an ODBC connection to fetch data.

Subscribe to our blog