Using Parameter Actions to Dynamically Update the ‘Relative to’ section of a Table Calculation

by Alessandro Costanzo

In one of my previous posts, I wrote about Dynamically Update the ‘Relative to’ section of a Table Calculation, using a parameter.

Now with the release of Tableau 2019.2, and the introduction of Parameter actions, it is possible to dynamically select a member of a dimension as the ‘Relative to’ part of a Table Calculation.

In this blog post, I will explain how to achieve this result.

For this example, I will use the dataset Sample-Superstore.

To begin with, create a parameter using your desired dimension (in this example sub-category). If you are unsure how to create a parameter check my previous post here.

Set the parameter as follows:

The allowable values can be set to either “All” or “List”, just make sure that all members of the dimension are present.

Then drag the dimension on the view.

Drag a measure onto the view (in this example profit).

Right-click onto the measure pill and select Add Table Calculation. If you select one of the following types of calculation, Difference from, Percentage difference from or Percent from you will see a section called “Relative to” appear.

From here you will be able to select the parameter previously created. Make sure to select “specific dimension” in the “Compute using” section, otherwise only the options “First”,”Last”,”Previous” and “Last” will be available.

Now you only need to set up the parameter action. If you are unsure how to do so, check this other post on the subject.

And that’s it. Now clicking on any member of your dimension will set that member as the ‘Relative to’ section of the Table calculation.

Avatar

Alessandro Costanzo

Reflections on my DataDive experience

2 mins read

Tue 21 May 2019

Quick Tableau Tip: How to create filter buttons for your Dashboard

2 mins read

Tue 14 May 2019

How to create a Top-N Highlighter which dynamically shows the cumulative % of total

3 mins read

Mon 06 May 2019

Dashboard Week - Day 3 Flourish

2 mins read

Wed 01 May 2019