Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 51 | |
| 41 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 125 | |
| 108 | |
| 47 | |
| 30 | |
| 25 |