Adding a threshold line in a chart

Contents[Hide]

1. Overview

Often it is useful to be able to add threshold lines to a chart to provide the user with target context. This article will guide you on how to add a static or dynamic threshold line to a chart. While the static threshold is a constant numeric value, the dynamic method is taking advantage of formula placeholders, which are essentially variables that can be controlled by users via filter controls. 

2. Setup

This article uses a simple bar chart created using AdventureWorks2012.

Bar chart setup
Bar chart setup

3. Static Threshold Line

To add a threshold line representing a constant numeric value on the y-axis, you can use a formula measure with a set value.

Open the formula bar for the chart and click on the Output button. 

Select the Line Chart visualization.

Select the Line chart visualization from the Output
Select the Line chart visualization from the Output

Now enter the threshold value for the chart in the formula bar and click apply.

Enter the threshold value in the formula bar
Enter the threshold value in the formula bar

The formula result is added to the chart as a Line series.

You can format the line series from the Properties panel like you would a regular series, such as give it a different color to highlight the value.

Static threshold line
Static threshold line

4. Dynamic Threshold Line

In order to add a dynamic threshold line, i.e. where users can change the value, you can add a measure placeholder in the formula expression.

Open the formula bar for the chart and click on the Output button.

Select the Line Chart visualization.

Enter a placeholder value such as $lineValue$ in the formula bar and click apply.

Note
The name is random as long as the placeholder is marked with opening and closing dollar ($) signs.

Add a placeholder measure
Add a placeholder measure

Add a filter control, such as Slider filter, to the dashboard.

When connecting the filter to the placeholder, uncheck any default connections and expand constant($lineValue$). Connect the filter to the (SingleNumber) hierarchy.

Connect filter control to (SingleNumber)
Connect filter control to (SingleNumber)

Change the properties of the slider filter to accomodate the threshold value.

Change the properties for the slider filter
Change the properties for the slider filter

Now you will be able to change the value of the threshold line using the slider filter.

5. See Also

 

 

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri