How to Mark Key Dates: Vertical / X-Axis Highlights

Looking to call out critical dates or date ranges? Do you want to do this on pivoted data?

Some example use cases for this include: highlighting promotion or event dates, drawing attention to specific trends / insights, or marking time intervals (e.g. highlighting the start of each week).

We can do this using table calculations:

  • First, create a table calculation to obtain the height of the vertical bar you’d like to plot. In most cases this will be the maximum y-value (such that the highlighted range extends to the top of the chart).
    c19095ec3b4ba551f6c8fc75af52aab75f94abbe.png
  • Second, create a table calculation that specifies which dates we’d like to highlight. If we have pivoted columns, we can use the pivot_index function to collapse them into a single column. For example, here is the table calculation we’d use to highlight the date range 6/7/18 to 6/11/18:
    34c9c2602ff322a718ec3ff700029bce6b35f70a.png

Now we have all the components to create our visualization:

  • Hide the intermediate table calculation from the visualization
  • Select a mixed chart type: line for data you’d like to plot, column for the date marker
7 3 6,450
3 REPLIES 3
Top Labels in this Space