How to create different time periods in Tableau? How do I create two time periods using a formula in Tableau?

  • Tableau FAQs
  • December 12, 2018
Get Started Transforming Your Data in Snowflake

Tableau has many functions that you can use to work with dates. So, for example, the MONTH () function displays the month number from the date without considering the year, the YEAR () function displays the year, the WEEK () function displays the week number, etc.

Here are some examples:19.01 Tableau

19.02 TableauYou can also use the DATETRUNC () function to display the beginning of the month (as an example); this is useful when you need to display the month in date format:

DATE(DATETRUNC('month', [Modified Date]))

DATE( – Since the data in the Modified Date field is stored in Datetime format, we need to convert the function result to Date format, for this, we use the DATE () formatting function

DATETRUNC(‘month‘, – this is a required argument, here we specify the details of the data. In our case, it is Month, but it can also be Year or Day.

 [Modified Date]) – this is also a required argument, and here we indicate the field based on which we will do the calculations of the date


Up Next:

Read How to create a new dimension in Tableau which will incorporate only some selected values of the original dimension? Should I use the IF contains a statement to isolate some attributes from a dim?

Related Posts

Top 5 Snowflake tools for Analysts- talend

Top 5 Snowflake Tools for Analysts

  • Ndz Anthony
  • February 26, 2024