Often times when we are working with multiple filters, Tableau can behave in a way that can be jarring. If you make a filter combination that doesn’t exist, all the sheets those filters apply to just disappear. This can be confusing to your end users and frustrating as a viz designer. Luckily, there are some tricks we can do to minimize the risk of this happening and provide users with guidance when it does.
For the purposes of this example, I’ve created a fake dataset about cats. In this dataset, I have a number of indicators about cats and data for multiple states and years. As you can see, I’ve set the data up so that all the indicators are in one measure with a descriptive dimension of what the indicator is so that I can easily filter through the different indicators.
The problem with my data is that not all indicators are measured every year. Number of Cats is measured every year, but cans of tuna consumed is only measured on odd numbered years and cuteness quotient is only measured on even number years. Also, hours of snuggles provided was only measured starting in 2009.
I wanted to create a map that uses a filter to choose the different indicators and different years. I’ve already guided the user a bit by showing year as the first step and indicator as the second. But, if I select an indicator that doesn’t have any data for that year, this happens:
We can help prevent users from making this mistake using having the filter only show relevant values. Since I have decided that I want users to pick a year first and then pick an indicator, I can make the indicator filter only show values for years in which there is data. I can do this by clicking on the dropdown menu in the top right corner of the filter and selecting “Only Relevant Values” in the menu.
Now after I select a year, only indicators with values for that year will be displayed. This will help prevent the user from getting the scary blank screen that we saw earlier.
It is still possible for a user to get a blank screen, though. If they have an indicator selected and then switch the year to a year that doesn’t have data for that year, everything will go blank again. We could fix this by doing the same “Only Relevant Values” option that we did for the indicators, but what if we really want every year to always be displayed?
When everything disappears from your dashboard due to a lack of data, the sheets literally do disappear. We can take advantage of this and hide things behind the sheets to deliver a message to the end user. In the dashboard I built for this example, all my dashboard objects are floating. When things are floating, it’s easy to put one thing in front of the other. I created an image that tells the user that they made an invalid selection. Once it was in place, I right-clicked on it, went down to floating order and selected “Send to Back”. This means that it is behind everything else on the dashboard.
Now, when you make an invalid combination of filters, the message will be displayed. Try it yourself. Change the indicator to “Cans of tuna consumed” and then change the year to 2006.
Obviously, my image is a little silly and there’s more serious ways you can do this. You could write out a message using a text box. You could make a table of what year/indicator values are possible. You could embed a link to this very blog post. Anything you can put on a dashboard you can put behind your sheets. Sometimes easy little tricks like this can really improve the user experience of your viz and help novice users of Tableau Public understand how to interact with it.