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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.