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?
| Feature | What it draws | Supported on |
|---|---|---|
| Trend line | the overall direction over time | area, clustered column, line, line and clustered column (time data) |
| X-axis constant line | a vertical line at a fixed value | area, bar and column charts, line, ribbon, scatter |
| Y-axis constant line | a horizontal line at a fixed value | as above, plus waterfall |
| Min, Max, Average, Median, Percentile | a line at that statistic of a measure | area, clustered bar, clustered column, line, scatter |
| Symmetry shading | the area where X and Y are equal | scatter |
| Error bars | variability around each point | supported charts, by field or by percentage |
| Forecast | predicted future values | line chart |
| Find anomalies | unusual points with an expected range | line chart |
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?
- Select a column chart of monthly revenue.
- Open Analytics, Y-Axis constant line, Add.
- Set the Value to a number, or with fx to a measure:
[Revenue Target]. The line moves with filters. - 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?
- Microsoft Learn: Use the Analytics pane in Power BI
- Microsoft Learn: Anomaly detection tutorial for Power BI
- Microsoft Learn: MEDIANX function (DAX)
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.