Analytics pane in Power BI: lines, forecasts, error bars

What the Analytics pane in Power BI adds to a visual, constant, min, max, average, median and percentile lines, trend lines, error bars, forecasts with seasonality and confidence intervals, anomalies, which visuals support each, and the DAX version of each line.

Short answer: the Analytics pane (the magnifier icon next to Build and Format) adds reference lines and statistics to the selected visual: constant lines on X or Y, min, max, average, median and percentile lines, trend lines, error bars, forecasts and anomalies. Each line follows the filters. Which ones are offered depends on the visual: forecasts and anomalies only on line charts, symmetry shading only on scatter charts.

A column chart says what each month sold. An average line says which months were above average, a target line which ones hit the goal, and a forecast what the next three months may bring, all without a second visual.

What can you add, and where?

FeatureWhat it drawsSupported on
Trend linethe overall direction over timearea, clustered column, line, line and clustered column (time data)
X-axis constant linea vertical line at a fixed valuearea, bar and column charts, line, ribbon, scatter
Y-axis constant linea horizontal line at a fixed valueas above, plus waterfall
Min, Max, Average, Median, Percentilea line at that statistic of a measurearea, clustered bar, clustered column, line, scatter
Symmetry shadingthe area where X and Y are equalscatter
Error barsvariability around each pointsupported charts, by field or by percentage
Forecastpredicted future valuesline chart
Find anomaliesunusual points with an expected rangeline chart
Analytics pane features (from Microsoft's list)

You can add several lines of one kind: three constant lines for three thresholds, two percentile lines for the 25th and 75th.

How do you add a target line?

  1. Select a column chart of monthly revenue.
  2. Open Analytics, Y-Axis constant line, Add.
  3. Set the Value to a number, or with fx to a measure: [Revenue Target]. The line moves with filters.
  4. Name it, style it (colour, dashed), and turn on its Data label with the name and value.

The target as a measure:

Monthly Target =
DIVIDE ( SUM ( Budget[Amount] ), DISTINCTCOUNT ( 'Date'[Month] ) )

How does the forecast work?

On a line chart with a continuous date axis, Forecast, Add draws the predicted values with a shaded confidence band. The options:

  • Forecast length: how many points ahead (for example 3 months).
  • Ignore the last: leave out the most recent points, for example an incomplete current month, or to test the forecast against known values.
  • Confidence interval: 75%, 80%, 85%, 90%, 95% or 99%; wider bands for higher confidence.
  • Seasonality: the number of points in one cycle (12 for monthly data with a yearly pattern), or automatic.

Use Ignore the last with the forecast length to check quality: hide the last 3 known months, forecast 3, and see how close the forecast came.

How do error bars work?

Error bars show a range around each point. By field: upper and lower bound fields or measures from the model, either absolute (the values are the bounds) or relative (distances from the measure). By percentage: a fixed percentage above and below. Style them with colour, width, border and cap markers.

A survey score per region with a 95% confidence interval as error bars (By field, Absolute):

Avg Score = AVERAGE ( Survey[Score] )

Score Margin =
1.96 * DIVIDE ( STDEV.S ( Survey[Score] ), SQRT ( COUNTROWS ( Survey ) ) )

Score Upper = [Avg Score] + [Score Margin]
Score Lower = [Avg Score] - [Score Margin]

A region with 40 answers gets a long error bar, one with 2,000 a short one: readers see which differences are real.

Can you get the same lines with DAX?

Yes, and sometimes you need to: a line that should appear in a tooltip or a table, or on a visual that does not support it.

Average Month =
AVERAGEX ( ALLSELECTED ( 'Date'[Month] ), [Revenue] )

Median Month =
MEDIANX ( ALLSELECTED ( 'Date'[Month] ), [Revenue] )

Above Average =
IF ( [Revenue] > [Average Month], 1, 0 )

Put Average Month on the chart as a line series (a combo chart), and Above Average into conditional formatting to colour the columns above the line.

What goes wrong?

  • The option is missing. The visual does not support it, or the chart has a legend or several series where the feature needs one; check the supported list.
  • Forecasts on too little history. Two years of monthly data is the minimum for a yearly season; with less, the band is wide or the forecast is flat.
  • An incomplete last period. The current half month drags the trend and forecast down; ignore the last point.
  • Average of what? The average line averages the points on the chart (months), not the transactions. Say so in its label.
  • Small multiples. Trend lines and forecasting are not available on small multiples yet.

Where can you check this?

Where do you start?

Add a Y-axis constant line bound to a target measure on your main chart, and an average line where "above or below normal" matters. Anomaly detection covers the anomalies option in depth.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.