Power Bi : Build a simple Linear Regression Equation in DAX to Predict a Goal

Power Bi : Build a simple Linear Regression Equation in DAX to Predict a Goal

20.867 Lượt nghe
Power Bi : Build a simple Linear Regression Equation in DAX to Predict a Goal
**UPDATE**: We have reached 850 SUBSCRIBERS as of 3/17/2022. What date did the model predict we would hit this goal - https://youtu.be/4vB28dwiHUI We have reached 500 subscribers! In this video I will teach you how to build a simple linear regression model to predict the exact day when the channel will hit 1,000 subscribers. 0:00 Start 0:28 YouTube Dataset 2:01 Calculate Running Total 6:24 The Regression Equation 8:37 Regression in DAX 16:25 Graphing Regression Line 17:10 The Slope 24:57 Expected Goal Date 29:12 Regression past Current Day 35:16 Thank You! I apologize about the audio quality during the first few minutes. Issues with my MIC. Helpful blog: https://xxlbi.com/blog/simple-linear-regression-in-dax/ DAX FORMULAS - RUNNING TOTAL: TimeFrameSubscribers = CALCULATE(Sum(Subscribers[Subscribers]), FILTER(ALLSELECTED(Subscribers), Subscribers[Date] &lt= Max(Subscribers[Date])) ) REGRESSION EQUATION (DAX): RegressionLine = var data = FILTER( SELECTCOLUMNS(ALLSELECTED(Subscribers), "x_values",Subscribers[Date], "y_values",[TimeFrameSubscribers] ), AND( NOT(ISBLANK([x_values])), NOT(ISBLANK([y_values])) ) ) --Variables to Solve for: var y_sum = SUMX(data,[y_values]) var x_sum = SUMX(data,[x_values]) var x2 = SUMX(data,[x_values]^2) var xy = SUMX(data,[x_values]*[y_values]) var row_count = COUNTROWS(data) --Solve for formula var Intercept = (y_sum * x2 - x_sum * xy)/ (row_count * x2-(x_sum) ^2) var Slope = (row_count * xy - x_sum * y_sum)/( row_count * x2-(x_sum) ^2) --Regression var Regression = SUMX(Subscribers, Slope * Subscribers[Date] + Intercept) return Regression