MIP Logo

Dynamic Reference Line

relative paths in alteryx

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

Welcome back to my blog. Today I will be showing you how to make a dynamic reference line in Tableau. In the realm of Tableau, reference lines stand as guides, offering a visual anchor to our data visualizations.

Essentially, a reference line is a straight or curved line that extends across a plot area, serving as a benchmark against which data points can be compared. These lines are invaluable tools in the hands of data analysts and visualization enthusiasts, providing a means to highlight key metrics, signify targets, or showcase trends within the data. I am going to show how to allow the user to change where the reference line is depending on their needs.

The first step is to create your graph. In my case I will be making a simple sales bar chart.

The next step is to create a parameter which will be called Target. This parameter needs to be set to a range of integers. Set the max and min to include all your data points.

Next, you need to bring a reference line onto the chart and set the value to the parameter that you created. Here I called mine Target. You should now have a dynamic reference line. Test it by changing the value of the parameter.

I’m going to take this one step further by adding some colour to the chart. I would like the bars above the target to stand out from the rest. If you create a calculated field that says whether each point is above or below the target.

Drag this onto colour and change the colours to highlight what you want to show.

Here is what my chart looks like.

I hope you have found this blog helpful.

Share this post