Comparing Prior Year Data by Month

Published: 17 Sep 2013
Last Modified Date: 16 Aug 2019


How to create a monthly year-to-date comparison filterable by calendar month.


Tableau Desktop


The following instructions can be reviewed in the workbook attached below.
  1. Open Tableau Desktop and select Analysis > Create Calculated Field to create a calculated field.
  2. In the Calculated Field dialog box, enter a name for the field. In this example, the field is named "Prior Sales".
  3. In the formula field, create a calculated field similar to the following and click OK:
  4. Drag Order Date to the Rows shelf, and then click the plus sign (+) on the YEAR(Order Date) field to expand to QUARTER(Order Date).
  5. Right-click on QUARTER(Order Date) and select Month.
  6. Double-click Sales and Prior Sales in Measures to add them to the view.
  7. Right-click on Prior Sales on Measure Values, and select Edit Table Calculation.
  8. Under Compute using, select Specific Dimensions.
  9. Check the boxes next to Month of Order Date and Year of Order Date. Click OK.
  10. From the At the level drop-down menu, select Year of Order Date.
  11. From Restarting every drop-down menu, select Month of Order Date, and then click OK. Note: if the option is greyed-out, you may need to re-arrange the order of the Specific Dimensions. 
  12. Right-click MONTH(Order Date) on Rows and select Show Filter.

Additional Information

To view the above steps in action, see the video below.
Note: the video has no sound.

Discuss this article... Feedback Forum
Did this article resolve the issue?