How to Add a Reference Line to Scatter, Bar, and Line Charts in Power BI?

Here’s a question from Joey :

I’m creating performance reports in Power BI, and I need to add a target line to my charts. How can I add a reference line to scatter, bar, and line charts to show our company’s performance goals across different metrics?

Our Answer

This tutorial will guide you through the process of adding reference lines to scatter, bar, and line charts in Power BI, using an HR performance scenario as an example.

Data Model

Assume we have a single table named “Employees” with the following columns:

  • Employee ID (Text)
  • Department (Text)
  • Month (Date)
  • Sales Amount (Decimal)
  • Customer Satisfaction (Decimal)
  • Productivity Score (Decimal)

Step-by-Step Instructions

1. Create a measure for the reference line in Power BI

First, we will go ahead and create a measure for our target line. In this example, let’s set a monthly sales target of $10,000.

In Power BI – from the Modeling tab create the following measure definition:

Sales Target = 50000

2. Add a reference line to a bar chart

  • Create a stacked column chart using “Month” on the axis and “SalesAmount” as the value.
  • Select your chart, then from your right side pane, hit Format.
  • In the Format section, scroll down to the Reference Line section.
  • Define your reference line settings and customize the line’s appearance (color, style, etc.) as needed. Note that we use the measure defined in the previous step to define the value of the benchmark line.

Here’s our custom line definition:

Here’s our chart with the benchmark line:

3. Add a reference line to a line chart

  • Create a line chart using “Month” on the axis and “ProductivityScore” as the value.
  • Create a new measure for the productivity target:
Productivity Target = 85
  • Follow steps in the previous section (bar chart instructions), using the “Productivity Target” measure.

4. Add a reference line to a scatter chart

  • Create a scatter chart with “SalesAmount” on the X-axis and “CustomerSatisfaction” on the Y-axis.
  • To add a vertical reference line, use the “Analytics” pane and add a constant line for the X-axis.
  • To add a horizontal reference line, repeat the process for the Y-axis.

Remember

  • If the reference line doesn’t appear, check if the measure is correctly defined and selected.
  • Ensure the line’s value falls within the chart’s axis range. Adjust the axis settings if necessary.
  • Combining multiple reference lines (e.g., in scatter plots) creates quadrants for easy categorization.

Advanced Reference Line Scenarios

Dynamic Reference Lines Based on Data

Instead of using fixed values, you can create reference lines that adapt based on your data. For example, create a measure that calculates the average performance across all departments:

Dynamic Sales Target = AVERAGE(Employees[Sales Amount]) * 1.2

This approach is particularly useful when targets should reflect realistic expectations based on historical performance rather than arbitrary goals.

Multiple Reference Lines for Performance Zones

Consider adding multiple reference lines to create performance zones on your charts. For instance, you could establish three zones:

  • Green zone (above 120% of target): Exceptional performance
  • Yellow zone (80-120% of target): Meeting expectations
  • Red zone (below 80% of target): Needs improvement

Create separate measures for each threshold and add them as distinct reference lines with different colors and line styles.

Cross-Chart Reference Line Consistency

When building dashboard reports with multiple charts, ensure reference lines maintain consistent values across related visuals. This creates a cohesive analytical experience and prevents confusion when users compare different chart types showing the same metrics.