Tableau Tips: Dynamic Scatter Plots using Parameters

by Ben Connor

A space efficient and user friendly way to make your dashboards more interactive and engaging in Tableau is to make use of parameters to edit the view on the fly. A good example of this in action is a dynamic scatter plot where the measures for both axes can be changed.

As an example I will be using the Sample - Superstore data which comes with Tableau installations.

Setting up Parameters:

The first thing to do is to set up the parameters which will be used for our X and Y axes. To do this, right click on the arrow at the top of the data pane and click 'Create Parameter'

Then, in the 'Create Parameter' window, switch the allowable values to 'list' view and manually enter the measures that you want to be able to choose from in your scatter plot for the X axis (I chose Sales, Profit and Discount) - remember to name it something descriptive e.g. 'X Axis parameter'.

Once you click OK the parameter will appear in the parameters section of the data pane below the tables section. To easily see if your parameter is set up correctly you can right click on it and select 'show parameter'. This will make it visible as a drop down menu on the right of your sheet which should contain the measures you entered in the table.

You can now repeat the same process above to create another parameter for the Y axis.

Setting up Calculated fields:

The second stage is to create some calculated fields which reference our parameters so that they will update whenever we select a new option in the drop down menus. This is a fairly simple 'IF' statement, stating that if the parameter is set to sales the we want the field to return the sum of sales, if it is set to profit then return sum of profit etc...

Again remember to name it something easy to find!

This step can then be repeated, creating a second identical calculated field for the Y axis but remembering to reference your Y axis parameter instead.

Building the Chart:

Now all that is left to do is build the chart itself, drag the X axis calculated field to  the columns and the Y axis calculated field to the rows and place any dimension (e.g. Customer ID) to the detail shelf to give an example.

Completed Chart

This is the completed chart after a couple of formatting changes, the axes can be changed to show whichever measures required by changing the parameters in the drop down menus.

It can also be helpful to drag the parameters themselves onto the rows/columns so that they will display which measures are currently in the view as shown above.