The Quadrant dilemma

In this blog post I will be covering how to create a dynamic coloured quadrant with parameters and reference lines.

As this has to be dynamic we cant just manually colour annotation boxes as these will not move along with the dynamic reference line.

Step 1: Create an X and Y axis

For this tutorial I will be using data from 2020 rugby league player statistics.           Firstly we need to start off by defining an x axis parameter, (found in the data pane next to the create calculated field) make sure data type is set to string and allowable values is set to list. Now you want to manually type the name of each dimension you want to be used in this axis (remember the spelling you write here as this will be case sensitive to when you are calling back the parameter in the calculated field). Replicate this for the y axis as well.

Step 2: Creating a calculation to link to this parameter

Once the parameter is created it still needs a calculation to refer to for the parameter to work. So in this calculated field we are calling back the parameter in the first line after the opening of the CASE function this works similar to an if statement but is tidier and requires less typing than 5 else if statements. As mentioned earlier make sure the word between the " " matches the spelling you used for the list of dimensions when creating the parameter (as it is case sensitive). Replicate this calculation for the y axis as well (to save time just duplicate the calculation and replace the parameter call back with the y axis parameter).

Tip : for this to work you cant do the sum of the fields in this calculation as later on Tableau will not be able to aggregate an aggregation resulting in an error.

Step 3: Showing the parameter

This is fairly straight forward but a very essential step.                                                     Start off by right clicking on the parameter (in the parameter section of the data pane) and select show parameter. Then drag the x and y calculations onto the rows and columns pane and add a dimension like name onto the detail pane. If all goes well you should end up with a chart like and are able to switch between different dimensions on the parameters shown in the top right corner.

Step 4: Creating reference line parameters and adding these to reference lines.

To start with lets head over to the analytics pane and go to reference line

When in the reference line pane as shown above select create new parameter, that should then take you to the screen shown below. Here you want to name the parameter and set it to range and leave as is. This should then create a reference line computed by this new parameter then right click on this new parameter in the parameter pane. once it shows in the right hand corner right click again and set to type in. Then repeat these steps to create a parameter reference line for the y axis.

If all goes well you should end up with a graph similar to the one shown below and then we are ready for the final step.

Step 5: creating a colour quadrant calculation that will adjust with your parameters.

To do this we have to create a calculated field that covers all quadrants and designates each quadrant a new colour. This can be done by creating a new calculated field.

Tip : for this to work you cant do the sum of the fields in the metric cal x calculation (x axis calculation) calculation as Tableau will not be able to aggregate an aggregation resulting in an error. As you can see this calculation covers all quadrants and assign's a colour to each quadrant in the form of if and else if statements.  

And finally drag this calculation to the colour pill on the marks card we have dynamic coloured quadrants.

That is how to create dynamic coloured quadrants I hope this guide has been useful.

Author:
Charalambos Pavlou
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab