Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
is it possible to return multiple rows back from a linestx function? Running one regression model at a time is not good enough as I need to have a line chart with a legend showing multiple lines at the same time
Solved! Go to Solution.
The LINESTX function itself always returns a single row, containing the result of a single least squares regression.
However, if you placed a particular column as the legend of a line chart, a measure that used LINESTX would carry out the regression for each value of that column.
Could you give some more detail on how you would want your visual to work along with sample data?
Apologies - I was sidetracked and didn't respond to your reply!
You have likely resolved this since your last post!
I had a play around in any case. (My regression measure is probably not identical to yours)
The built-in line chart can't display two measures if a legend is included, but I created a line chart showing the y Estimate (bottom chart).
You could also use the built-in trend line regression, which should give the same result (top chart).
Hopefully this is useful if you are still looking at this.
Regards,
here is my matrix of the data that I want to run a regression model on and a line chart of the actual values
Apologies - I was sidetracked and didn't respond to your reply!
You have likely resolved this since your last post!
I had a play around in any case. (My regression measure is probably not identical to yours)
The built-in line chart can't display two measures if a legend is included, but I created a line chart showing the y Estimate (bottom chart).
You could also use the built-in trend line regression, which should give the same result (top chart).
Hopefully this is useful if you are still looking at this.
Regards,
The LINESTX function itself always returns a single row, containing the result of a single least squares regression.
However, if you placed a particular column as the legend of a line chart, a measure that used LINESTX would carry out the regression for each value of that column.
Could you give some more detail on how you would want your visual to work along with sample data?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |