How to create Sets from Custom Dates

The direct interaction with a dashboard in Tableau is facilitated by Sets that can be of two types: fixed or dynamic. After the creation of a set, you can find it at the bottom of the Data pane in Sets action. If you want to create a custom date you can use in the Data Pane functions as datepart or datetrunc. Today we will show you how to create sets from these Custom Dates, a useful method that allows time comparison flexibility for different KPIs.

Let’s see which are the steps:

Step 1: Connect to data

→In Tableau Desktop, connect to Global Superstore data provided by Tableau.

Step 2: Create computations

Create a custom date named ‘Year’:

Right-click on Order Date field → Create Custom Date Detail: Years → Date Part

Create a custom date named ‘Month’:

Right-click on Order Date field → Create Custom Date Detail: Months → Date Part

Create a set named ‘Year Selection 1’:

Right-click on Year field → Create Set → Choose a value

Create a set named ‘Year Selection 2’:

Right-click on Year field → Create Set → Choose a value

Create a set named ‘Month Selection 1’:

Right-click on Month field → Create Set → Choose a value

Create a set named ‘Month Selection 2’:

Right-click on Month field → Create Set → Choose a value

Create a calculated field named ‘Filter Selection 1’:

Year Selection 1 AND Month Selection 1

Create a calculated field named ‘Filter Selection 2’:

Year Selection 2 AND Month Selection 2

Create a calculated field named ‘Sales Selection 1’:

SUM (IF Filter Selection 1 THEN [Sales] END)

Create a calculated field named ‘Sales Selection 2’:

SUM (IF Filter Selection 2 THEN [Sales] END)

Create a calculated field named ‘% Change’:

(Sales Selection 1 – Sales Selection 2)/ Sales Selection 2

Step 3: Create graph

Add Sub-Category field on rows and Measure Names field on the filter (choose Sales Selection 1, 2 and % Change fields) and columns

Add Measure Values field on Marks

Format as a percentage from view: Right-click on % Change field → FormatNumbers PanePercentage

Display sets: Right-click on previously-created sets → Show set

Also, watch the video tutorial here:

A skillpill created by Ana Brinaru – Data Analyst at btProvider.

About btProvider:

We hold all possible technical and sales certifications for all products: Tableau Desktop, Tableau Public, Tableau Server, Tableau Prep, Tableau Data Management.

With Tableau Software – the best data visualization platform – you can always understand your business or your job better. Using Tableau, you will take smart and strategic decisions and you will quickly understand the data flow, numbers and results it produces.

Are you interested in learning more about Tableau Software – one of the best analytics tools and implementing the solution in the entire company? Contact us!

See how Tableau works, by downloading a free trial here: