Forum Discussion
DAX Polynomial Regression Calculation Issue
- 5 years ago
I think the main problem here is this: COUNTX(VALUES(Table1[date]),Table1[date])
This is evaluated within the local filter context and returns 1 for each row corresponding to a single date.
Try this instead: COUNTROWS ( ALLSELECTED ( Table1[date] ) )
Hi, PLEASE HELP!!
I'm prototyping a similar calculation in excel for a 4th order polynomial with a 5x5 matrix, but I cannot seem to generate the same result as LINEST() in excel, see attached....
https://1drv.ms/x/s!AsId0OAmsuzuhOEh7CR03iyUCLAbng?e=fiK5ay
I've used the Chio method of expansion to compute the determinant...
https://www.youtube.com/watch?v=_JetUVpvFAU
I've then computed matrix of minors and matrix of cofactors to work out the inverse of the original 5x5 matrix, as instructed here...
https://www.mathsisfun.com/algebra/matrix-inverse-minors-cofactors-adjugate.html
Thanks
- kopite8333 years agoFrequent Visitor
Found a solution for a 5x5 matrix using Chio method of expansion and Cramer's Rule, parsing the solution vector into a series of matrices, to calculate determinants divided by the original determinant to solve for the polynomial regression coefficients...
- ToddFEagle20232 years agoNew Member
I have a matrix with 2 columns from which i want to run a polynomial regression to the fourth degree to fit a line on data. The fourth degree is to smooth the data basically looking at daily data with a smoothing effect over a four week period. I can't seem to convert the equations of the DAX code above to give me the results of a fourth degree and struggling to convert your excel spreadsheet to those equations. Any help would be greatly appreciated.