Tableau dashboards allow you to apply filters to the view, typically using dropdowns, sliders, or checkboxes.
Wouldn’t it be nice to have buttons for this functionality instead? You can do this with a simple trick. In this blog post, I’ll explain the process step by step.
For this example, I’ll use the included Sample-Superstore dataset.
- Drag the dimension you want to use, in this case, Region, onto the columns shelf.
- Drag the measure “Number of Records” next to it.
- Right-click the “Number of Records” pill and change the aggregation from SUM to AVG. This will always return the value ‘1’.
- Right-click the axis and select “Edit Axis.”
- Choose the range “Fixed” and set it as follows: Fixed start: 0, Fixed end: 1.
- Hide the axis and dimension names by right-clicking them and unticking “Show Headers.”
- Drag the same dimension you used for the bars onto the Label marks. Click the text mark to adjust the alignment to your preference.
- To remove the lines around the buttons, right-click one of the bars, select “Format,” then “Borders.” Set every option to “None.”
- To prevent tooltips from showing, press “Tooltip” on the Marks shelf and untick the “Show tooltips” option.
- Place this sheet onto a dashboard. Click it and select the little funnel icon on the right-hand side. You can also set the view to “Entire View” for larger buttons.
That’s it! Now you can use these buttons to filter other views within the dashboard. In this example, I’m filtering the US states by their region.