Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
julsr
Helper V
Helper V

Scatterplot with trendline no available

Hello!

I have a scatter plot like the one below. However, what I need now is to have a trendline for each of my legend values. I previously saw this option in the analytics tab, but I can't find it anymore. How can I achieve this now?

This is the goal I want to achieve: "A scatter plot trend line is a straight line that is drawn on a scatter plot to visually represent the general direction and strength of the relationship between two variables. It's a way to summarize the overall pattern of points in a scatter plot, indicating whether there's a positive, negative, or no relationship"

 

julsr_0-1747089544615.png

Thanks

1 ACCEPTED SOLUTION

To add a trendline for each legend value in a Power BI scatter plot:

  1. Add the desired field to the Legend section of the scatter plot.
  2. Select the scatter plot and open the Analytics pane.
  3. 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.
  4. 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.

View solution in original post

5 REPLIES 5
burakkaragoz
Community Champion
Community Champion

Hi @julsr ,

 

To add a trendline for each legend value in a scatter plot in Power BI:

  1. Ensure the legend field is added to the "Legend" section of the scatter plot.
  2. Go to the Analytics pane (select the scatter plot first).
  3. If the Trend Line option is missing:
    • Make sure you're using the built-in scatter plot visual, not a custom one.
    • Check that "X-Axis" and "Y-Axis" fields are numeric.
    • Power BI only supports one trendline per series, so the legend must split the data into multiple series.

If the option still doesn't appear, try updating Power BI Desktop to the latest version, as this feature may have been temporarily removed or changed.

Thank you both @v-venuppu ! The problem is that my X-axis is a Date Hierarchy. It works with one month as the days are not repeated, but when trying with multiple months, the values are incorrect (For example, if viewing from Jan 01 to Feb 01, the values for the first day appear at a single point on the x-axis.). Is it a limitation of the Power BI Scatter plot?

To add a trendline for each legend value in a Power BI scatter plot:

  1. Add the desired field to the Legend section of the scatter plot.
  2. Select the scatter plot and open the Analytics pane.
  3. 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.
  4. 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.

Thanks. This worked for the trendline, I'll open another post for the issue with multiple months. 

v-venuppu
Community Support
Community Support

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! 

Thank you.

 

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.