How to use a Parameter to select a range of dates on a line graph

Finished Graph:

In this example we will use the Sample - Superstore dataset.

First we need to drag the SUM(Sales onto Rows and MONTH(Order Date) onto Columns:

Then we need to create a 'start date' Date & Time Parameter:

Then we need to create a 'end date' Date & Time Parameter:

Now we need to create a Change Parameter action for this sheet under the Worksheet tab and call it 'start date', ensure the Aggregation is set to 'Minimum':

Now we need to create a Change Parameter action for this sheet under the Worksheet tab and call it 'end date', ensure the Aggregation is set to 'Maximum':

Right click and select the 'start date' and 'end date' Parameters to 'Show Parameter'. Now as we select a range of dates we can see our 'start date' and 'end date' update:

Under the Analytics tab, drag a 'Reference Band' onto the Table MONTH(Order Date):

Update the 'Band From' Value to be 'start date' and the 'Band To' Value to be 'end date'. Change the fill color to your preference:

Now we can see our selected range updating to orange:

Author:
John Power
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab