KNOWLEDGE BASE

Finding the Month-to-Date Values for the Prior Year


Published: 20 Jun 2014
Last Modified Date: 07 Dec 2015

Question

How to find the month-to-date values for the prior year, relative to today. 

Environment

Tableau Desktop

Answer

  1. Select Analysis > Create Calculated Field.
  2. Name the calculated field "1 Year Ago".
  3. Enter the following calculation:
    DATEADD('year', -1, TODAY())
  4. Click OK.
  5. Select Analysis > Create Calculated Field.
  6. Name the calculated field "Date Trunc".
  7. Enter the following calculation:
    DATETRUNC('month', DATEADD('year', -1, TODAY())
  8. Click OK.
  9. Select Analysis > Create Calculated Field.
  10. Name the calculated field "Date Filter".
  11. Enter the following calculation:
    [Order Date] <= [1 Year Ago] AND [Order Date] >= [Date Trunc]
  12. Click OK.
  13. Drag the Date Filter calculated field to the Filters shelf.
  14. Select True and click OK.
Did this article resolve the issue?