Tableau - Date Calculations


Dates are one of the key fields which is extensively used in most of the data analysis scenarios. Hence, Tableau provides a large number of inbuilt functions involving dates. You can carry out simple date manipulations such as adding or subtracting days from a date. You can also create complex expressions involving dates.

Following are the steps to create a calculation field and use date functions in it.

Create Calculated Field

While connected to Sample superstore, go to the Analysis menu and click ‘Create Calculated Field’, as shown in the following screenshot.

Create calculation

Calculation Editor

The above step opens a calculation editor, which lists all the functions available in Tableau. You can change the dropdown value and see only the functions related to Date.

date calc 1

Create a Formula

Now, find out the sales volume along with the difference in the date of sales in months from 21st March 2009. For this, create the formula as shown in the following screenshot.

date calc 2

Using the Calculated Field

Now to see the created field in action, you can drag it to the Rows shelf and drag the Sales field to the Columns shelf. Also drag the ship Date with months. The following screenshot shows the Sales values.

date calc 3

Useful Video Courses


Tableau Online Training

Best Seller

88 Lectures 10 hours

Pavan Lalwani


49 Charts in Tableau - (Latest Version)

64 Lectures 4 hours

Pavan Lalwani


Visualising Data using Tableau

18 Lectures 1 hours



Tableau Hands-on: Learn Data Visualization with Tableau

45 Lectures 5.5 hours



Master Data Visualization with Tableau

14 Lectures 53 mins

Harshit Srivastava


Learn data visualization by tableau

40 Lectures 3.5 hours