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).
- 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:
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