Save the Date: Some useful date calculations for Tableau

This afternoon was all abouts dates in Tableau Desktop. I thought it would be useful to have a collection of date calculations.

What is a date in Tableau?

A date in Tableau is essentially an integer, so one whole number. Tableau counts the number of days since Tableau Default Date, which is 01 January 1900. This means today (13 January 2026) is 46,033 days 'old'. Tableau displays the date in different, more commonly understood ways, such as 13/01/2026 or 13 Jan 2026.

When it comes to dates we sometimes want to look at things which are not the data we have. This means we need to look at some calculations:

To create dates:

TODAY() → returns todays date.

NOW() →  returns todays date and the current time.

MAKEDATE(2020/07/08) → this will return a date value based on the year, month and day input, in this case it is 08 July 2020. MAKEDATE can be used to combine Year, Month and Day fields into one Date field (MAKEDATE([Year],[Month],[Day]).

DATE("2020-07-08") → returns a date from a number, date or string expression

DATEPARSE('MMddyy', '070820') → turns a string into a date following the specified format. The format given in the first helps Tableau to understand the date.

Note :
MM returns the month in numbers, eg. 11 for November
MMM returns a three letter abbreviation of the month, eg. Nov for November
MMMM returns whole name for month, eg. November
MMMMM returns first letter of month, eg. N for November

To get information about dates:

ISDATE() →  returns a TRUE if given string is a valid date or FALSE if it isn't
ISDATE('08July2020') → False
ISDATE('08-July-2020') →  True
ISDATE('08/Jul/2020') →  True
ISDATE('20200807') →  False

DATENAME() → returns a string representing a part of a date
DATENAME('month', #08/07/2020#) → "July"
DATENAME('weekday', #08/07/2020#) → "Wednesday"

To add or subtract from dates:

DATEADD() → adds a specified number of date parts (days, weeks, months, etc.) to a date.         
DATEADD('day', 7, #08/07/2020#) → 15 July 2020
DATEADD('month', -1, #08/07/2020#) → 08 June 2020

DATEDIFF() → returns the difference between two dates based on the chosen date part.         
DATEDIFF('day', #08/07/2020#, #15/07/2020#) → 7
DATEDIFF('month', #08/07/2020#, #08/08/2020#) → 1

To adjust dates:

DATETRUNC() → rounds a date down to a specified level of detail.
DATETRUNC('month', #08/07/2020#) → (01) July 2020
DATETRUNC('year', #08/07/2020#) → (01 January) 2020

To extract parts of a date (numeric):

DATEPART() → returns a number representing a part of a date.
DATEPART('year', #08/07/2020#) → 2020
DATEPART('weekday', #08/07/2020#) → 4

To get individual date components quickly:

DAY() → returns the day of the month (1–31).         
DAY(#08/07/2020#) → 8

MONTH() → returns the month number (1–12).         
MONTH(#08/07/2020#) → 7

QUARTER() → returns the quarter number (1–4).       
QUARTER(#08/07/2020#) → 3

YEAR() → returns the year as a number.         
YEAR(#08/07/2020#) → 2020

WEEK() → returns the week number of the year.         
WEEK(#08/07/2020#) → 28

To compare dates:

MAX() → returns the most recent date of range. This can also be a field like [Order Date]        
MAX(#08/07/2020#, #01/07/2020#) → 08 July 2020

MIN() → returns the earliest date of range         
MIN(#08/07/2020#, #01/07/2020#) → 01 July 2020

Before I end it there I also wanted to share a quick tip:

Tableau uses the Gregorian calendar by default, meaning the first week of the year starts with the week containing 01 January. The ISO 8601 calendar works differently and start with the first Monday of the year. (or Sunday depending on when your week starts)
To change between the two right click on your data source and select date properties. Here you can change setting depending on what you need.

Author:
Nicola Huetz
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
© 2026 The Information Lab