This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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.
Solved! Go to Solution.
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.
Please check if the attached PBIX file gives you the values you need when you change the slicers.
Please check if the attached PBIX file gives you the values you need when you change the slicers.
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.
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.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 45 | |
| 28 | |
| 24 | |
| 22 |