Tableau - Date Differences

Find the difference between two dates using DATEDIFF

                    DATEDIFF(date_part, start_date, end_date, [start_of_week])

The date_part can be:

  • day
  • week
  • month
  • quarter
  • year

[start_of_week] is an optional parameter which can be any day of the week (i.e "Monday", "Tuesday", etc)


Find the number of months between two specified dates

                    DATEDIFF('month',#2017-07-01#, #2017-09-01#)

Find the number of days between two specified dates

                    DATEDIFF('day',#2017-01-01# , TODAY())

Some tips:

  • Change data type to date
  • Change data type to discrete

DATEDIFF with DATETRUNC lets you track date differences without hard coding a specific date.

  • SEO
  • Online Advertising
  • Online Ordering For Restaurants
  • Data Analytics

  • External Resources 4 Developers
  • CSS Tricks
  • MDN

  • Dash-Intel is a Power BI and Tableau resource site for data visualization and building BI dashboards.

    Data Analytics consultants in Edmonton, Alberta specializing in Tableau and marketing analytics

    Copyright 2021 Terms / All rights reserved.
    Powered By The Order Guys