Creating a Dynamic Reference Line

by Finn Charlton

If you need to create a reference line that moves to a selected point, this is the blog for you. I will show you how to achieve this using simple parameter actions.

Simply, we will create a parameter to determine where our reference line sits. We will then use a parameter action to change that parameter, and therefore the reference line position, based on where we click.

Lets start by creating a chart:

Now lets add a reference line. Select the "analytics" pane and drag "reference line" to your measure.

The "Edit Reference Line" box will appear. Here we can change what determines the position of our line. In "Value" - choose "Create a new parameter". Default settings for this parameter are fine.

We now want our parameter to change based on the points we click on. We use a parameter action to accomplish this. Select Workbook>Actions and then Add Action>Change Parameter.

We can then define our parameter action. We want to "Run action" (i.e. change the reference line position) when we select a point. Our target parameter should be the one we just created, and the "source field" should be the measure we want the reference line to reflect.

You should now have a reference line that moves to any point you select!