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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
BhanumathiSivan
New Member

Scatter Chart | Slope, Intercept, R-Square | Power BI

Hi,

 

My scenario is,
I have a master table, that has columns like Bri, Tri, Yrw, Frn in Master table.
We need to give the user the ability to compare any two parameters. So, I have used 2 Field Parameter slicers. With this I am able to plot the graphs expected. But we also need to find slope, intercept and R-Square as shown in last screenshot.
In order to achieve it I tried LINESTX() and LINEST() but this is not working.

I have attached the Source and Power BI File here. Please refer and help me solve this.

 

Thanks.

2 ACCEPTED SOLUTIONS
v-veshwara-msft
Community Support
Community Support

Hi @BhanumathiSivan ,

Thanks for reaching out to Microsoft Fabric Community.

Since you’re using Field Parameters to allow users to select columns dynamically, the behavior with LINESTX is expected because the function requires fixed column references and doesn’t support parameter-driven fields directly. One approach is to reshape the data model so that the selected attributes are stored in consistent columns such as ValueX and ValueY, which can then be used in regression calculations.

 

After that, you can apply LINESTX over the filtered table where AttributeX and AttributeY correspond to the selected parameters using SELECTEDVALUE from the slicers. If LINESTX still doesn’t return results due to context issues, slope and intercept can be calculated manually using SUMX and AVERAGEX over the filtered data.

For Reference:
LINESTX function (DAX) - DAX | Microsoft Learn
Similar discussions: Solved: Trend line - R2, slope and interception - Microsoft Fabric Community
Solved: LINESTX - not able to see the intercept and slop... - Microsoft Fabric Community
Solved: LINESTX with slicer - Microsoft Fabric Community

Hope this helps. Please reach out for further assistance.

Thank you.



View solution in original post

kushanNa
Super User
Super User

Hi @BhanumathiSivan 

 

Please check if the attached PBIX file gives you the values you need when you change the slicers.

Recording 2025-10-22 060753.gif

 

Reference: https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-select-column-based-on-s... 

 

View solution in original post

5 REPLIES 5
kushanNa
Super User
Super User

Hi @BhanumathiSivan 

 

Please check if the attached PBIX file gives you the values you need when you change the slicers.

Recording 2025-10-22 060753.gif

 

Reference: https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-select-column-based-on-s... 

 

v-veshwara-msft
Community Support
Community Support

Hi @BhanumathiSivan ,

Thanks for reaching out to Microsoft Fabric Community.

Since you’re using Field Parameters to allow users to select columns dynamically, the behavior with LINESTX is expected because the function requires fixed column references and doesn’t support parameter-driven fields directly. One approach is to reshape the data model so that the selected attributes are stored in consistent columns such as ValueX and ValueY, which can then be used in regression calculations.

 

After that, you can apply LINESTX over the filtered table where AttributeX and AttributeY correspond to the selected parameters using SELECTEDVALUE from the slicers. If LINESTX still doesn’t return results due to context issues, slope and intercept can be calculated manually using SUMX and AVERAGEX over the filtered data.

For Reference:
LINESTX function (DAX) - DAX | Microsoft Learn
Similar discussions: Solved: Trend line - R2, slope and interception - Microsoft Fabric Community
Solved: LINESTX - not able to see the intercept and slop... - Microsoft Fabric Community
Solved: LINESTX with slicer - Microsoft Fabric Community

Hope this helps. Please reach out for further assistance.

Thank you.



Hi @BhanumathiSivan ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
Thank you.

Hi @BhanumathiSivan,

Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

BhanumathiSivan
New Member

Hi,

 

My scenario is,
I have a master table, that has columns like Bri, Tri, Yrw, Frn in Master table.
We need to give the user the ability to compare any two parameters. So, I have used 2 Field Parameter slicers. With this I am able to plot the graphs expected. But we also need to find slope, intercept and R-Square as shown in last screenshot.
In order to achieve it I tried LINESTX() and LINEST() but this is not working.

I have attached Source and Power BI File  for reference. Kindly review and help me solve this.

Thanks.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.