Forum Discussion
Anonymous
5 years agoNot applicable
DAX Polynomial Regression Calculation Issue
I am attempting to implement a 2nd order polynomial regression to fit some data. It appears that I can calculate the coefficients for the regression equation correctly, but I just cannot figure out h...
- 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] ) )
Anonymous
5 years agoNot applicable
That's a facepalm moment. I was indeed using the measures instead of the variables. Thanks!
So the moral of the story is that local filter context is passed down through dependent variables too. That is something I would not have considered.
AlexisOlson
5 years agoSuper User
Yes. Each VAR is calculated within the local filter context.