If you are a beginner user to Tableau, you may be aware of the automatic legend that appears when you apply a Measure to a worksheet. There you can interact with the legend's highlight feature.
Did you know there are alternatives to displaying legends on a dashboard? In this blog I will show you how to create legend buttons for filtering a dashboard!
This is one of the first tricks I learned from a colleague Richard Koehler.
In a worksheet I created an inline calculation by right-clicking on the Columns shelf and selecting New Calculation.
In the empty pill that appeared I typed min(1).
This creates a blue bar in a worksheet.
I then right-clicked on the axis of this bar chart and selected Edit Axis.
On the Edit Axis pop-up menu, I selected Custom for the Range and changed the Fixed end from 2 to 1.
This removes the white space and extends the blue bar all the way to the end of the worksheet!
Then I moved the Category column to the Rows shelf.
I moved Category to the Color Marks card.
I also moved Category to the Label Marks card.
I then right-clicked on Category on the Rows shelf and deselected Show Header to hide the extra Category label in the view.
I also performed this step to hide the header on the bottom axis.
I changed the Font size to 10 pt.
I also center-aligned the Label text.
I now have a sheet I can use as a legend with buttons for my dashboard!
I placed this sheet on a dashboard with the Scatterplot previously shown and clicked on the Use as a filter icon on the sheet.
When you click on a Bar in this sheet, it filters the scatter plot. See the video below for more details!
One thing to note, you may have to have Category in the Detail marks card of your other worksheets for this legend to work.
The Flerlage Twins have a great article listing eight alternatives for legends in their blog site here.
Comments