Forum Discussion
Scatterplot with trendline no available
- 1 year ago
To add a trendline for each legend value in a Power BI scatter plot:
- Add the desired field to the Legend section of the scatter plot.
- Select the scatter plot and open the Analytics pane.
- If the Trend Line option is missing:
- Ensure you're using the built-in scatter plot visual, not a custom one.
- Confirm that both X-Axis and Y-Axis fields are numeric.
- Power BI supports one trendline per series, so the legend must split the data into multiple series.
- If the option still doesn't appear, update Power BI Desktop to the latest version.
Note: Using a Date Hierarchy on the X-axis may cause issues with trendlines, especially when multiple months are selected, due to overlapping day values.
translation and formatting supported by AI
Hi julsr ,
Thank you for reaching out to Microsoft Fabric Community.
Unfortunately, Power BI’s built-in scatter plot supports only one trendline when no legend is used. Once you add a "Legend" field, the trendline option in the Analytics pane disappears - which is what you're seeing.
To achieve trendlines per group/legend, here's a working workaround:
1.Use Line and Clustered Column Chart or Line Chart Instead
Switch to a Line Chart or Line and Clustered Column Chart.
Place your X-axis (e.g., Date) and Y-values as normal.
Put your Category field (previously in the legend) in the "Legend" field.
This chart supports multiple series with their own lines, acting like trendlines.
If needed, smooth the lines in the Format pane.
2.Use Scatter Plot + DAX Trendline Calculation
If you must use a scatter plot, do the following:
Create a new DAX table with calculated trendline points for each category:
TrendData =
VAR Categories = VALUES(YourTable[Category])
RETURN
ADDCOLUMNS(
GENERATE(
Categories,
SELECTCOLUMNS(
YourTable,
"X", [YourXValue],
"Y", [CalculatedYTrendline] -- e.g. regression or average line
)
),
"Category", [Category]
)
- Add this new table to your scatter plot.
- Use different marker styles or lines to visually represent the trend.
For more details, you can refer to below Documentation:
Scatter, bubble, and dot plot charts in Power BI - Power BI | Microsoft Learn
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!