top of page

How to Filter with Parameter Actions in Tableau

Updated: Oct 19, 2022

Tableau has some incredibly powerful tools for interacting with your data. This 4-part series contains a number of tips and tricks for leveraging those tools to build business dashboards that are more flexible, more engaging, more powerful, and generally, just a lot more fun to use. This is part 1 of the series and covers how to use Parameters and Parameter Actions to filter your dashboard. It also covers how to use calculated fields to "remove" a Parameter selection, and how to counter Tableau's default highlighting using Highlight Actions. Check out the Resources below for a link to the dashboard referenced in this blog post, and to a short video demonstrating all of the steps in this post.

Resources:

 

Using Actions to filter your dashboard not only looks much nicer than Quick Filters, but it is also better for performance and provides a more satisfying user experience. There are several methods for doing this including Filter Actions, Set Actions, and Parameter Actions. In this example, we are going to use Parameter Actions. The first thing we want to do is create our Parameter and our Filter Calculation

  1. Create a new parameter called "Region Par", select String as the Data Type and set the Current Value = All

  2. Create a calculated field called "Region Selected" for our filter

    1. [Region Par]="All" OR [Region Par]=[Region]

  3. Go to one of the worksheets that you wish to filter (ex Metric by Sub-Category)

  4. Drag the "Region Selected" field to the filter shelf and set filter = True

  5. Right click on the filter, select "Apply to Worksheets" then "Selected Worksheets" and select all of the worksheets that you want to apply the filter to

Next we want to create our Parameter Action

  1. Click on Dashboard > Actions

  2. Click "Add Action"

  3. Select "Change Parameter"

  4. Give the Parameter a name

  5. Deselect All Worksheets (see bonus tip below)

  6. Select the worksheet that will drive the Parameter Action (ex. Metric by Region)

  7. Choose "Select" under the "Run Action On" options

  8. Under "Target Parameter", select the "Region Par" parameter

  9. Under "Field", select the field that we want to pass to the parameter, in this case "Region"

  10. The final parameter should look like this

Bonus Tip - In a Tableau Action there is no option to bulk select or bulk deselect worksheets, but what you can do is click on the first worksheet in the list, hold down shift, click on the last worksheet in the list, and then click on the checkboxes to select or deselect all sheets.

Now when we click on any bar in the Metric by Region sheet, we can filter the entire dashboard to that region. However, you may notice that unlike filtering with Action Filters or Set Actions, you can't click again to remove the filter. Once the filter is applied, there is no way to remove it. We can fix this with another calculated field.

  1. Go to the "Metric by Region" worksheet

  2. Create a calculated field called "Region Remove"

    1. IF [Region]=[Region Par] THEN "All" ELSE [Region] END

  3. Drag the "Region Remove" field to Detail

  4. Update your Dashboard Action

    1. Go to Dashboard > Actions

    2. Click on the Region Parameter action created in the previous step

    3. Click "Edit"

    4. Under "Field" select the "Region Remove" field instead of "Region"

Now you can click on a region to filter the dashboard, and then click on that region again to remove the filter. You have probably also noticed that when you click on a mark, the selected mark retains it's formatting, and all of the non-selected marks turn a "washed-out" version of their color, which often times is unattractive and in some cases can be very distracting. Next we'll cover how to counter that default highlighting and get more control over the formatting of both the selected and non-selected marks.

  1. Go to the "Metric by Region" worksheet

  2. Create a calculated field called "HL" that is just a blank calculation (enter just "" in the calculation body)

  3. Drag the "HL" field to Detail

  4. Go back to the dashboard and add a Highlight Action

    1. Click on Dashboard > Actions

    2. Click "Add Action"

    3. Select "Highlight"

    4. Give the Highlight Action a name

    5. Under Source Sheets select the "Metric by Region" worksheet

    6. Under Target Sheets select the "Metric by Region worksheet

    7. Choose "Select" under the "Run Action On" options

    8. Under "Target Highlighting" choose "Selected Fields"

    9. Select the "HL" field

    10. Click OK

    11. The final highlight action should look like this

Now when you click on a bar, you can filter the dashboard to that Region, and all marks retain there original formatting, but it is difficult to see which, if any, Region is selected. We can remedy that with the use of color

  1. Go to the "Metric by Region" worksheet

  2. Drag the "Region Selected" field to color

  3. Set the colors for the True and False values

    1. In this worksheet I have set the color for True to be that same baseline Blue color, and for False I have set it to the same color as the background

That is all for today. Keep an eye on our blog for parts 2 through 4 over the coming weeks which will cover using BAN's as KPI selectors, dynamically formatting labels and tooltips, sheet-swapping with parameters, creating "scroll" buttons, and adding instruction "overlays". If you have any questions or comments on these tips, please let us know at info@cleartelligence.com.

bottom of page