Reference Lines and Trend Lines in Data Studio
Staying up to date with the latest features, additions and refinements to Google’s data visualisation platform, Data Studio, can be a tough task. Rarely does a week go by without a small change here and there, thankfully usually a notable improvement over what came before it, but you would be forgiven for missing the odd update. Some of the very best new features might not be immediately clear, so we’re here to help shed some light on the lesser known features and updates that you may have missed.
The latest feature we’d like to highlight is the addition of built-in Reference Lines for certain widgets. These are a great tool when you want to add some extra detail to your line graphs and bar charts, such as a target, projection, or rolling average. Reference lines help you to both better understand your data to drive your decision making, and to better present that data to other members of your team and stakeholders.
Plotting Averages and Percentiles as Reference Lines
Thankfully, adding reference lines is now a really simple process, and we’ve finally moved past the roundabout methods of placing graph widgets on top of one another like a digital overhead projector (are we showing our age?) or trying to blend data sources together to create a manual reference line. Let’s look at an example using a line graph that shows pageviews of the GlowMetrics Blog on a weekly basis, over the course of twelve months. We’ll look at adding a few different lines here, starting with a rolling average.

Pageviews are moderately variable here, and we want to see a simple representation of the average number of Blog pageviews. We can create a dynamic line that will change as the data changes, should we look at a different date range, or apply a filter. Click on Add A Reference Line in the widget’s style menu, and select the Type as Metric. You can then select one of the metrics currently added to your widget, as well as the calculation upon which the line is based: Average, Median, Percentile, Min, Max, and Total. Select Average, which in this instance plots the Mean onto the graph. We can then label this graph as well as implement the usual display options.

We can add more than one Reference Line to a single chart. Click on Add A Reference Line once again, and a second set of options will appear. This time, we’re going to plot a line that helps to highlight the top performing weeks. We can do this by using a line based on the 90th Percentile, meaning that 90% of our weekly data will sit below this line, and the top 10% above the line. Similarly, let’s add a line that shows us the lowest 10% as well, the 10th Percentile.

Adding these dynamic percentiles is really useful for highlighting instances of particularly high or low performance, helping you to identify potential areas for further analysis. Percentiles are also crucial when it comes to recognising outliers and anomalies.
Adding Constant Values
In addition to the dynamic lines above, we can also add constants to our widgets. These are ideal for plotting targets, or baselines. The process is much the same, however when we select the Type of Reference Line, we’re going to click on Constant instead of Metric. This is the default option, and means that we’re going to enter a value to plot on the graph, rather than a line being dynamically based on a calculation involving a specific metric.
Let’s look at our Blog pageviews example once again, and pretend we’ve set a target of getting 2,000 pageviews a week. We can present this on the graph by adding a line that has the Constant Value of 2000. This new line represents our weekly target, and we can easily analyse our true performance against this target.

In addition to our weekly target, let’s say that we also have a target for this twelve month period of 85,000. It wouldn’t really make sense to show this value on our graph in its current form, as we’ve broken down the Pageviews on a weekly basis, and a line showing a constant value of 85,000 is going to sit considerably higher than our data. In this instance, we can go to the Style menu for the widget, and under the options for our Line, tick the box for Show Cumulative. This will change the line from showing a weekly breakdown, to showing a running total. We can then plot our target line alongside this new cumulative line, and quickly determine how we’re performing against that target; Have we hit our target? When did we hit it? Where was our highest period of growth? Etc.

The Different Types Of Trend Lines
It would be amiss of us to talk about Reference Lines without… ahem, referencing, the option to also include trend lines. These differ in how the line is calculated, but are also very much a good option to have when creating graphs in Data Studio. These have been available for a while now, and are a great way of showing the direction that certain metrics have been trending, and is another efficient way of increasing the value of your visualisations.
You’ll find this option above the Reference Line menu, in the Style menu of an appropriate widget. You have three options to choose from: Linear, Exponential, and Polynomial. If that sounds a bit too much like a mathematics class from years gone by, here’s a quick reminder:
Linear – The line of best fit i.e. the most accurate representation of the data when plotted as a straight line.
Polynomial – A curved trendline that shows directionality within your data. This is best suited to metrics with a high level of variability.
Exponential – Best suited to data that can be described as showing exponential growth or decline. Specifically, this is an exponential of the form eax+b. When it comes to data from Google Analytics or Google Ads, it’s unlikely you’ll need to use this, but can still be very useful when analysing other data sets.


Optimising Your Data Visualisations
Reference Lines and Trend Lines are an excellent way of making small but valuable improvements to the presentation of data on graphs and charts within a Data Studio dashboard. These may seem like very simple additions, and they are, but remember that every optimisation that can be made is a chance to improve the effectiveness and efficiency of the information presented. This makes it easier for users to interpret and understand the data you’re visualising for them, which in turn helps to increase the value and utility of a dashboard.
It’s also important to remember that you should only add information that you deem to be relevant. The essence of effective data visualisation is presenting data in a clear and concise way. Remember, we’re steering away from spreadsheet after spreadsheet of numerical data! Make sure that any lines, annotations, and details you add to a visual element of a dashboard has a purpose. In other words, don’t clutter your visualisations with unnecessary information and make them appear overcomplicated, as this can quickly remove the benefits of taking a more visual approach to data.
For more on data visualisation and Google Data Studio, please feel free to leave a comment below or contact us at contact@glowmetrics.com. You can also follow us on Twitter @GlowMetrics for more tips, guides, and up to date news in the world of Digital Analytics and Marketing.
Hello,
I am on a project on datastudio and I wanted to know if it was possible on a graph to create an mail alert if a curve exceeds (for example) by 20% its trend line or its average.
I think the polynomial trendline is the best one for my project buy I didn’t find how to do the soustraction between the curve and the trendline (with %) and create the alert.
Thank you
Hi Nayel,
Thanks for getting in touch. Unfortunately, I don’t think it’s possible to set up alerts based on a Data Studio dashboard yet, this would need to be done directly on the data source (alerts in Google Analytics for example – https://support.google.com/analytics/answer/1033021).
The closest thing you’d be able to implement on Data Studio would be conditional formatting on a scorecard or table that shows the result of the percentage difference between the metric and its average. You can find the conditional formatting options in the setup menu on the right when you’ve selected a widget.
Thanks,
Conor
Hi Conor,
Hope this message will still get to you. I’m pretty new to Looker Studio, and I believe this is the old Data Studio. I’m able to add trendlines to a chart but cannot seem to find the parameters for the trendline anywhere. For example, if I add a linear trendline, I would like to know the slope and intercept. I tried to hover over the trendline, nothing shows up. Any ideas on what else I can try?
Thank you!
Penny
Hi Penny,
Thanks for getting in touch with us. This is a really good question – but unfortunately I think you’ve uncovered a real gap in the way Data Studio/Looker Studio adds these trendlines. You’re absolutely right, there’s no way to quickly see the information like slope and intercept behind trendlines in the same way you can with other graphs and reference lines.
You can however download data within widgets (if you have the relevant permissions) by clicking on the options icon to the top right of a component when you hovering of it. One solution might be to download the the chart in question and export the data to a spreadsheet like Excel or Google Sheets, and then calculate the values there using the raw numbers. It’s a bit of a manual workaround admittedly, especially if it’s something you’d be looking to do on a regular basis and have easily recorded, but unfortunately I think this might be the easiest way at the minute.
I’d also recommend checking out the Community Visualisations from the toolbar – you’ll find this between “Add A Chart” and “Add A Control” while in Edit mode. There are a lot of different charts available here that aren’t built into Looker Studio natively, and you can find more online that you can add via the “Build Your Own” option, so perhaps one of these might work as a potential solution.
Apologies I’m not able to provide a more clear cut answer as to how you’d easily get those values. I think it’s a really good question and definitely a missed opportunity. Small quality of life updates to Looker Studio happen quite regularly, so if this is something that’s added in the future, I’ll be sure to let you know. I hope this helps with your question at least a little!
If there’s anything else we can help with, or you have any other Data Studio / Looker Studio questions, please don’t hesitate to get in touch.
Many thanks,
Conor