Use this simple 4-step tutorial to add a ‘filter in use’ alert to a Tableau dashboard to tell your end users when a filter is being applied.
This is Ryan with Playfair Data TV. And in this video, I’m going to show you how to add a filter in use alert to a Tableau dashboard. One of the features that I like about Excel that isn’t quite replicated in Tableau is the ability to see when a filter is being applied. It’s kind of tricky unless you’re in Tableau desktop and you can see the filters shelf, you don’t always know how the data is being filtered.
This technique I’m about to show you will be a way to improve the user experience by showing the end user when there is a filter taking place. This is one of many tactics that I like to share using this super sample superstore dashboard. This was kind of a creative use of the sample data set that we’ve all become used to using.
But what we’re going to do is add a filter in use right here. It’s going to eventually appear here in the middle of this dashboard. And if a filter is ever being applied, it will display very clearly that there’s a filter being applied. I’m going to start a new sheet. I’ll call this my filter in use alert. And a filter in use alert involves a calculated field with a fairly simple formula. It does use a level of detail expression. So it’s somewhat advanced but nothing you can’t do.
I’m going to call this my filter in use alert again. And the formula is if SUM number of records does not equal SUM fixed number of records, this is where the level of detail part comes in, the formula is open curly bracket the word fixed colon SUM number of records.
So this is saying if the number of records for this view does not match the fixed number of records for the entire file. So the entire file is 9,994 records. If the number of records in the view ever does not match the total number, we know there’s a filter being applied. So that’s why we’ve got this formula. When that takes place, we want Tableau to display the words filter or filters in use.
On the second line, so otherwise, we’ll just leave it blank. So two open quotes. And then if then logic always concludes with the word end. So there is my entire formula. I’m going to click OK. I’m going to drag that alert to the text marks card.
We don’t see anything show up yet. But it’s because there’s nothing being filtered. We need to make sure the filters that we want this alert to appear for are applied to this sheet. So I’m going to back out to this tab and go to any of the sheets that contain the filter in question. We’ll just add this region filter. We’ll apply that to the filter in use alert.
So I’m going to click on that filter hover over apply to worksheets, choose selected worksheets, and just ensure that filter in use alert is selected. And then I’m going to click OK. Go back to my filter in use sheet. And now it’s showing up. We see the filter on the filters shelf. Because the sheet is being filtered to the East region, the number of records for the East region does not match the total number of records for the entire dataset, so this shows up.
In the case of the filter in use alert, maybe I want to modify this, so it’s color coded red. Maybe make it a little bit bigger, whatever you want to do to the formatting. Click apply. Make sure those stick. Click OK. Once I’ve got it, as it’s own sheet, I can go back and add it to the dashboard. I’ll make this a floating object. Find the sheet that I want to add to the view, which is filter in use alert, I’ll kind of center it here, hide the title, change the fit, so it matches the entire view, and just get this to kind of line up as desired. And once we’re ready to use it, notice when I’ve got US selected, so, basically, we’re not looking at a specific region, so the number of records will match the records for the entire dataset. That alert goes away. As soon as we drill in and filter to a specific region, the filter in use alert pops up.
This has been Ryan with Playfair Data TV – thanks for watching!