KNOWLEDGE BASE

Comparing Two Date Ranges from the Same Data Set on One Graph


Published: 12 Apr 2013
Last Modified Date: 08 Dec 2016

Question

How to compare two date ranges from the same data set on one graph.

Answer

The following instructions use the Sample - Superstore data source.
  1. Create a calculated field for the first date range. The example below uses the year 2012:
    date(IF year([Order Date])=2012
    THEN [Order Date]
    END)
  2. Create a calculated field for the second date range. The example below uses the year 2013:
    date(IF year([Order Date])=2013
    THEN [Order Date]
    END)
  3. Place both calculated fields on the Columns shelf, selecting Continuous, Exact Date.
  4. Right-click the second date range and select Dual Axis.
  5. Drag Sales to Rows.
  6. Drag Order Date on the Color on the Marks card for All.
Did this article resolve the issue?