Search

Current Period Vs Previous Period Comparison in Tableau


Current period vs previous period comparison in Tableau isn't as straightforward as in Excel – however, it is much more powerful, because it allows the user to slice and dice, in order to see and understand the differences between various periods. Here is the set of controls that I want to offer to the users:

Current Period Vs Previous Period Comparison in Tableau dashboard

These controls take any day, month, quarter or year, and compare it to the previous period, or same period the previous year. The user can pick any metric and any period they like.

Let me show you how to quickly build this set of controls with Superstore data using only 4 simple parameters and 3 simple calculations!

Step 1. Configure parameters

  • Start date

  • Compare by

  • Compare to

  • Metric

Let's start with the start date picker. Right click on the side bar, and select 'Create Parameter'.

Use the following settings:

Data type: date

Display format: automatic

Allowable values: range

Check to set minimum and maximum range of values

Step size: 1 Day

Name the parameter 'Start Date' or 'Pick a Date' and click OK.

Current Period Vs Previous Period Comparison in Tableau - start date

To show this parameter, right click on it and select 'Show Parameter Control'. This lets your users set the start date.

Now, let's add the 'Compare by' parameter.

Right click on the side bar and select 'Create Parameter'.

Use the following settings:

Data type: string

Allowable values: list

Type in a list of values: day, month, quarter, year.

Name this parameter 'Compare by' and click OK.

Current Period Vs Previous Period Comparison in Tableau - compare by parameter

Show this parameter by right-clicking on it and selecting 'Show Parameter Control'.

This parameter will save us a lot of time. We will use it in our calculations to let the user drill down through the data.

Next, create the 'Compare to' parameter.

Right click on the side bar and select 'Create Parameter'.

Use the following settings:

Data type: integer

Allowable values: list

Type in a list of values: value: 1,2; display as: 'Prev Period', 'Last Year'.

Name this parameter 'Compare to' and click OK.

Current Period Vs Previous Period Comparison in Tableau - compare to parameter

Show this parameter by right-clicking on it and selecting 'Show Parameter Control'.

This parameter will allow users to select the period they want to compare to. We will use this parameter in our calculations later.

<