Tableau Tutorials: Table Calculation Parameter

Table calculations are a backbone of maximising the potential of Tableau and adding a parameter to them will allow the user to have control over the calculation. This blog post will go through how to insert a parameter into table calculations using Superstore data that is available on Tableau when opening the software.

Step 1:

In this tutorial, I will be using the Order Date dimension and right-click drag that onto the columns. Once that is done, a pop-up should come up and select the continuous Month.

Step 2:

For this tutorial I will be using a moving average created in a table calculation but first, we will create the parameter so that we can insert the parameter into the calculation. To create a parameter, click on the arrow under the data source and press 'Click Parameter'. For this example, the data type will be an integer and the allowable values section will have a range of values. The minimum is 2 and the maximum is 6 with the step size is 1, meaning that the difference between one value and the next will be 1, which corresponds to 1 month. The parameter setting should look the picture below and then press OK.

Step 3:

Now it's time to create the table calculation, which will be the moving average. The table calculation used here will be the window_avg, which looks at the average of the expression within the window. The moving average will look at the sum of sales and drag the parameter into the calculation pane after SUM[Sales] so that the calculation looks like in the picture below.

The moving average parameter is wrapped in a minus because that is how Tableau has to do the calculation. The +1 is used to calculate the moving average however the calculation counts the number of months backwards instead number of months for the moving average. Therefore, moving n months back and including the current month is one month more than the parameter. There is a 0 at the end because that represents the current month.

Step 4:

Insert the table calculation into the row and right click on the parameter created to show it on the side so that you can move the numbers along.

That leaves is us with a basic parameter in a table calculation. Feel free to format the chart however you please so that the visualisation looks clean as well as informative.

Author:
Thanoshaan Thayalan
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