I'm trying to add a DAX measure for R^2 in PowerPivot. I saw the answer linked and my current code is as follows:
=CALCULATE(
DIVIDE(
SUMX( 'Table'; ('Table'[Dates] - AVERAGE('Table'[Dates]) *
('Table'[Daily Result ($)]) - AVERAGE('Table'[Daily Result ($)]) ) );
(SQRT(SUMX( 'Table'; ('Table'[Dates] - AVERAGE('Table'[Dates])) ^2 ) ) ) *
(SUMX('Tablw'; ('Table'[Daily Result ($)])- AVERAGE('Table'[Daily Result ($)]) ^2)))^2
)
X axis is a sequence of dates and Y axis is a sequence of values. But this gives me nonsense values, sometimes well above one, while Excel's RSQ formula gives proper ones. How do I fix it/What am I doing wrong?