Calculating a Rolling 12-Month Value with DATEDIFF()
16 Sep 2014
Last Modified Date:
11 Apr 2018
How to create a calculated field for a rolling 12-month period of a value using DATEDIFF.
The following example is based on the Superstore sample data source.
Create Calculated Field
Enter the following calculation:
IF (DATEDIFF('month',[Order Date],TODAY()))<=12 THEN [Sales] ELSE null END
Enter desired name for the field.
Did this article resolve the issue?
Thank you for providing your feedback on the effectiveness of the article.
Click here to return to our Support page.
Open new Case
Open a new case
Click here to go to our Support page.
Get detailed answers and how-to step-by-step instructions for your issues and technical questions.
Find and share solutions with our active community through forums, user groups and ideas.
Browse a complete list of product manuals and guides. Available online, offline and PDF formats.
Training and Tutorials
Learn how to master Tableau’s products with our on-demand, live or class room training.
PRINT THIS PAGE
SUPPORT BY PRODUCT
TOOLS & DOWNLOADS
Download Tableau Desktop & Server
Tableau Online & Public Status
Send Large Files
All Tech Specs
Elite Account Management