Last Modified Date: 03 Sep 2015
AnswerThe following instructions can be reviewed in the workbooks attached below.
- Open Tableau Desktop and connect to the Sample - Superstore sample data.
- Drag Category to the Rows shelf.
- Drag Order Date to the Filters shelf.
- In the Filter Field dialog box, select Months, and then click Next.
- Select the check box next to January, and then click OK.
- Drag Order Date to the Detail card.
- Right-click Order Date on the Detail shelf and select Exact Date.
- Right-click Order Date on the Detail shelf and select Discrete.
- Select Analysis > Create Calculated Field.
- In the Calculated Field dialog box, enter a name for the field.
- In the formula field, create a calculated field similar to the following:
IF FIRST() = 0 THEN WINDOW_AVG(SUM([Sales]), 0, IIF(FIRST() = 0, LAST(), 0)) END
- Click OK.
- Drag the newly created calculated field from Measures to the Label card.
- Right-click the calculated field on Text shelf and select Edit Table Calculation.
- Under Compute Using, select Advanced.
- Move Category from Partitioning to Addressing, and then do the same for Order Date.
- Click OK.
- From the At the level drop-down menu, select Deepest.
- From the Restarting every drop-down menu, select Category, and then click OK.
Additional InformationA Jedi (Filter and Table Calc) Trick
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials