Dashboard Container for Filters

Floating Container for Filters

A floating container with a button is really useful for a busy dashboard. I didn’t quite grasp the concept the first time I saw this in action, so this example includes many screenshots to walk you through the process.

Introduction

This dashboard has two filter controls that I want to hide when not in use to allow more room for my visualization. I have one worksheet “Sales.” The filter controls are in a floating container. To demonstrate interactivity when the filter container is visible I want the container to have a yellow background so it overlays the Sales chart.

The “Filters” container overlaps the “Sales” worksheet so that the floating “Filters” container object is on top of the underlying “Sales” visualization. The “Filters” container is similar to a sticky note on top of a piece of paper. If you remove the sticky note, you can see the chart underneath. 

The container has a Show-Hide button to toggle visibility. You can add text, images, or tooltips to a button. I use a funnel image as a visual clue for a user to click the icon to show the container. When the container is open, clicking a “Hide” icon, “X,” toggles visibility and hides the container.

Project Files

Tableau Public File


Preview - the Finished Dashboard

First, I’d like to show you the “Sales” chart with the two filters on the right.

Now let’s look at the finished dashboard where the yellow floating container on the right is visible with two filter controls. You’d probably want to shade this container with white, but here I use yellow so you can see the stacked effect. The “X” image is a button to control visibility of the yellow filters container. The chart underneath is partially hidden by the yellow container so that the bar for “Cherry” is hidden.

Hide the Filters Container

When the filters container is closed, a small funnel icon in the top right area indicates there is a filters container. When a user clicks the icon the container is shown. 

Worksheets

There is one worksheet in this workbook.

Sales

Data & Fields

This chart utilizes these fields.

  Order Date

  Color

  Fruit

  Sales

Order Date

On the Filters shelf the data type  for “Order Date” is “Date.” For the “Order Date” field, I choose the Date Level “Date Part” of “Year.” A “Date Part” is discrete so individual years are shown in the Filter Control

Color

The “Color” field is a discrete dimension with a “String”  data type.  “Color” is on the Filters shelf and because I checked “Show Filter” from the drop-down context menu the Filter Control is displayed on the right side of the view. As expected, the field has a blue background  or “pill,”  because it is a discrete field. 

Fruit

The “Fruit” field is a discrete dimension with a “String”  data type. As expected, the field has a blue background  or “pill,”  because it is a discrete field. 

Sales

The data type  for “Sales” is a “Number (decimal).” In this view, “Sales” is a continuous field on the Rows shelf. This is a continuous field so it creates an axis on the view, and because the field is on the Rows shelf this is a y-axis or vertical.

Components or Elements

In addition to the calculated field, there are several elements to this view.

• Rows Shelf

• Columns Shelf

• Filters Shelf

• Filter Control

• Floating Dashboard Container with a Show/Hide Button

Rows Shelf

The aggregated field SUM(Sales) is on the Rows shelf and creates a vertical y-axis for values.

Columns Shelf

Looking back at the “Sales” worksheet you’ll see the “Fruit” field is on the Columns shelf. Because “Fruit” is a dimension headings are added to the view, in this case column headings at the bottom of the chart because “Fruit” is on the Columns shelf.

Filters Shelf

The discrete “Order Date” dimension field and the dimension “Color” are both on the Filters shelf. When you drag the “Order Date” field onto the Filters shelf choose the date part “Year” from the Date Context Menu

If you aren’t sure what date level you selected, click the drop-down arrow of “Order Date” field on the Filters shelf to open the Date Context Menu. The items in the middle section of the Date Context Menu are divided by a line. The top part has Date Part levels which is what we want. The bottom part of the Date Context Menu is actual Date Values.

Filter Controls

To display the Filter Control for both the “Color” and “Order Date” fields, click the drop-down arrow on the “Order Date” field in the Filters shelf. Check “Show Filter” from the drop-down context menu to display the  Filter Control on the right side of the view (and the dashboard.)

Dashboard Container

When I add the two filter controls to the dashboard Tableau automatically creates a new container for the filters. I rename this container to “Filters” and change it to a floating container. I also resize the Filters container so that it partially hides the chart underneath. 


Earlier, I said the “Filters” container is similar to a sticky note on top of a piece of paper. If you remove the sticky note, you can see the chart underneath. In the next image I rotated the chart to give a 3-D view perspective of the dashboard so you can see the stacked objects. 

The button image is an X when the yellow “Filters” container is shown and changes to a Funnel image when the Filters container is hidden. During testing, while in “Presentation” mode, we’ll click the button to show or hide the container.


Formatting

The only special formatting is the container has shading.

Create the Viz

 1. Create a simple “Sales” sheet as outlined above and then create a new dashboard. At the bottom of the view, click the  New Dashboard icon. Drag the worksheet “Sales” from the Dashboard pane on the left onto the dashboard. The “Sheets” list is in the middle of the Dashboard pane.

 2. Add the filters to the dashboard. Click the “Sales” worksheet on the dashboard. A dark bounding box indicates the “Sales” sheet is selected. In the top right corner of the bounding box click the drop-down arrow to open the shortcut menu. Select “Filters” and click on “Color.” A Filter Control for “Color” is added to the dashboard on the right side in a new “Vertical” container. 

Repeat the steps to add a filter for “Year of Order Date.” 

Note that both filter controls are in the same new vertical container. 

3. Next I want to rename the new vertical container, change the container to floating, and set a background color. To select the vertical container click anywhere in either Filter Control on the right. Click the drop-down arrow to open the shortcut menu. Near the bottom of the shortcut menu choose “Floating.” You should see the two filter controls inside this container.

4. A blue bounding box around the vertical container indicates the container is selected. Also, in the Layout pane at the bottom, the vertical container is shaded in the Item Hierarchy section, indicating this is the selected object. Right-click “Vertical Container,” choose “Rename Dashboard Item” and type “Filters.”

To switch to the Layout pane instead of the Dashboard pane, click the tab at the top of the pane.

5. Drag the edges of the bounding box in the view to resize the container.

6. In the top right corner of the bounding box around the “Filters “container click the drop-down arrow to open the shortcut menu and select “Floating.”  


At this point, the transparent “Vertical” container is floating above the main chart in the top right corner and not lined up properly.

8. Whenever you change a container to “Floating,” Tableau changes opacity to transparent. I want the background color to be yellow for the container for demonstration purposes. In the middle of the Layout pane on the left ,click the background color tool in the middle of the pane and choose a yellow color.


9. To add the show/hide button to the dashboard, with the container selected, click the drop-down arrow to open the Container Context Menu. Select “Add Show/Hide Button.” In this example, I’m using the default “X” image, which indicates the container is open or visible. Because the button is a separate floating object, you can drag it anywhere on the dashboard. 



Testing

Anyone that views the dashboard on a Tableau server can click the button icon to toggle visibility. Switch to Presentation Mode on the View menu to see the functionality in action within Tableau Desktop. On a Windows machine, Alt-click toggles visibility, or Option-click on macOS.

You can also use the drop-down shortcut menu for the button to switch between “Show” and “Hide.”


Thank you for reading! If you have questions or comments, you can reach me at cryoung6@att.net