Calculated Columns with DAX
Math Formula | DAX Formula |
x² | xsq = Salary_Data[Years of Experience]^2 |
xy | xy = Salary_Data[Years of Experience]*Salary_Data[Salary] |
Math Formula | DAX Formula |
n | n = COUNTROWS(Salary_Data) |
∑xy | xysum = SUM(Salary_Data[xy]) |
∑x | xsum = SUM(Salary_Data[Years of Experience]) |
∑y | ysum = SUM(Salary_Data[Salary]) |
∑x² | xsqrsum = SUM(Salary_Data[xsq]) |
(n(∑xy)-(∑x)(∑y))/(n(∑x²)-(∑x)²) | m (Slope) = DIVIDE( [n]*[xysum]-[Xsum]*[Ysum], [n]*[xsqrsum]-[Xsum]^2, 0 ) |
((∑y)(∑x^2)-(∑x)(∑xy))/(n(∑x²)-(∑x)²) | b (Intercept) = DIVIDE( [ysum]*[xsqrsum]-[Xsum]*[xysum], [n]*[xsqrsum]-[Xsum]^2, 0 ) |
Final Math Formula
Math Formula | DAX Formula |
y = mx + b | Predicted Salary = ([m (Slope)]* ‘x (Years of Experience)'[x (Years of Experience)Value]+ [b (Intercept)]) |