If you are building a dashboard, you often run into the situation that you might only want to show a certain worksheet if a condition is met. Tableau offers the possibility to make a worksheet seemingly disappear when it is blank
Let’s go through it following an example:
Imagine you are working with the superstore and you want the user to be able to switch between the sales by category or by segments.
![](https://www.thedataschool.co.uk/content/images/2022/04/ezgif-2-00720ca6fa.gif)
![](file:///C:/Users/FREDER~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.png)
Therefore we set up a parameter that allows choosing between three options. Then we create a calculated field because we can’t filter by the parameter itself. The calculated field is used as a filter on both worksheets.
A dimension in the rows or columns is needed on both worksheets. So if you don’t need one for the actual chart, you might want to create a dummy variable that just contains an empty string. Put this dummy into the rows and hide the header. A view won’t notice it is there, but Tableau requires it for us to make the worksheet exchange to function.
![](https://www.thedataschool.co.uk/content/images/2022/04/2022-04-11-11_44_57-Dialog.png)
Now we can create the dashboard. For our exchange of sheets to work, when we change the parameter, what we need is them to be inside a container. Then you can hide the title – if they are not hidden, it won’t work since the sheet would not be empty.
So to sum it all up, you need to:
1. Put your worksheets in a container
2. Hide the titles
3. Put a dimension onto rows/columns
And once you have completed those steps, your result should have the replacing-functionality.