R squared as measure in Excel Power Pivot

感情迁移 提交于 2021-01-29 03:10:36

问题


Is there a simple way to caclulate the R^2 value in a Power Pivot? In 'normal' excel, we can use the RSQ function but that function doesn't exist among the Measure functions in Power Pivot.


回答1:


Short answer: No. There's no native DAX equivalent of the Excel RSQ function.

You could create DAX calculations to determine the Pearson correlation (example) or you could use R script (example)




回答2:


As @Olly says, there isn't a built-in equivalent but the formula is not too difficult to write yourself.

Correl =
VAR AvgX = AVERAGE ( Table1[x] )
VAR AvgY = AVERAGE ( Table1[y] )
RETURN
    DIVIDE (
        SUMX ( Table1, ( Table1[x] - AvgX ) * ( Table1[y] - AvgY ) ),
        SQRT (
            SUMX ( Table1, ( Table1[x] - AvgX ) ^ 2 ) *
            SUMX ( Table1, ( Table1[y] - AvgY ) ^ 2 )
        )
    )



来源:https://stackoverflow.com/questions/57802291/r-squared-as-measure-in-excel-power-pivot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!