Last Modified Date: 20 Mar 2018
Environment
Tableau DesktopAnswer
The below example uses Sample - Superstore data.- Drag Order Date to Rows.
- Drag Sales to Columns.
- On the Marks card, change the chart type to Bar.
- On the toolbar, click the Abc button to show labels.
- Select Analysis > Create Calculate Field. Name the field such as [YTD Filter], and then enter the following formula:
IF DATEPART('month',[Order Date]) < DATEPART('month',TODAY()) OR (DATEPART('month',[Order Date]) = DATEPART('month',TODAY()) AND DATEPART('day',[Order Date]) <= DATEPART('day',TODAY())) THEN "YTD" ELSE "Future" END
- Drag this calculated field to the Filters shelf.
- Select YTD, and then click OK.
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials