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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
dashboardhelp
Regular Visitor

How can I display the slope and y intercept of the trendline?

Hi! I added a trend line using the analytics pane for my scatterplot. I need to display the slope and y intercept of the trendline on the scatter plot. Is there any way to do this? Thank you! 

3 REPLIES 3
Kevin_SC
Frequent Visitor

The answer to this god **bleep** question is that YOU CAN NOT easily display slope and intercept values on the chart for your trend line currently (like you would in Excel via check box for example).

Unless you reverse engineer the whole data set (exactly as it's shown on your chart with all filters and agreggations applied exactly as they are on the chart) and then write your own DAX to calculate SLOPE and INTERCEPT measure and drag these measure onto some card visuals. Of course you would also need to manually check is these values are correct.
Your other option is to use LINEST function to return a table which has a bunch of descriptive stats. This is esentially similar to an output you can get with Excel data analysis add-on. Again you would need to recreate all filters and agreggations before using this one.

You can also spend hours of your life looking for youtube hacks and creative workarouds for what by all means should have been a basic feature.

That's how intuitive and productive Power BI is.

jaweher899
Impactful Individual
Impactful Individual

it is possible to display the slope and y-intercept of a trendline on a scatter plot in Power BI. One way to do this is to use the R-squared value and trendline equation that Power BI provides in the Analytics pane, and then use these values to calculate the slope and y-intercept using the following formulas:

  • Slope = Trendline Equation Coefficient (in the form of y = mx + b)
  • Y-intercept = R-squared value (in the form of y = mx + b)

You can then use these values to create a custom label for your trendline that displays the slope and y-intercept.

Another way of achieving this would be to use the R script visual and write a script to calculate the slope and y-intercept of the trend line, and then use the resulting values to create a label in the scatter plot.

I cant see the r squared value or the trendline equation in the analytics pane. I only see trend line, x axis constant line, y axis constant line, and symmetry shading. Is there something I need to enable in settings to be able to see the r squared value and the trendline equation?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.