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

  Рет қаралды 18,203

Dapper Dash

Dapper Dash

Күн бұрын

**UPDATE**: We have reached 850 SUBSCRIBERS as of 3/17/2022. What date did the model predict we would hit this goal - • Power Bi : Evaluating ...
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 KZfaq 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: xxlbi.com/blog/simple-linear-...
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

Пікірлер: 39
@jamierandall-schab2694
@jamierandall-schab2694 Жыл бұрын
Having been learning PBI for the last few years and having watched lots and lots of videos - this is one of the best - absolutely awesome. I've already adapted it for new insights in my organisation. I'm subscribed
@DapperDash
@DapperDash Жыл бұрын
Hey Jamie. Thanks brother. Glad it helped you out. Sharing knowledge is how we all grow and learn. Appreciate the sub.
@rauljimenez5485
@rauljimenez5485 2 жыл бұрын
The breakdown of the linear regression is gold!!! Thank you very much for sharing this!!
@DapperDash
@DapperDash 2 жыл бұрын
Hey Raul! I appreciate the comment. Thank you. I am glad you found it useful.
@HomegrownHowTo
@HomegrownHowTo 2 жыл бұрын
Good info! Great stuff!
@DanielHernandezCa
@DanielHernandezCa 2 жыл бұрын
Thank you! Keep on the good work!
@gambu4810
@gambu4810 2 жыл бұрын
You are absolutely brilliant!! I'm subscribed, l guess because of this video you are reaching the 1k way earlier than predicted.
@DapperDash
@DapperDash 2 жыл бұрын
Thank you thank you 🙏. We are on our way to 1K. Baby steps.
@danieldemasi6904
@danieldemasi6904 2 жыл бұрын
That's really good. When i did this for my data I had to summarize the raw data as I had multiple entries per day.
@alexandreos35
@alexandreos35 Жыл бұрын
you taught me EXACTLY what I needed for my job! (by the way, in october, when I first watched this video you were at 1,3k subscribers, so your trendline must be correct, now I'm another sub!)
@oswaldocastro9600
@oswaldocastro9600 2 жыл бұрын
Incredible what you do... We close a difficult deal just by applying what I get from here. Fantastic job and really many thanks to share with us. Not just subscriber, a fan from now on!
@DapperDash
@DapperDash 2 жыл бұрын
Oswaldo, I totally missed your comment. That is amazing! I am glad the content was able to help you. That's what it is all about, helping each other out. I provided a video update so you can see how close the model is to where my channel is today. The link is in the description. Check it out.
@warrendeanthomas
@warrendeanthomas 2 жыл бұрын
Looks on you are on track for 1000 subs, good video!!
@DapperDash
@DapperDash 2 жыл бұрын
Hey Warren, haha yeah the regression told me sometime in June, so we'll see. I think it will be closer to July but it was a fun experiment
@PhoebeeMo
@PhoebeeMo Жыл бұрын
Hi Victor! This is awesome! I am so happy to find you. I am curious on when did you hit 1000 subscriber? :)
@AnilKumar-bd2yt
@AnilKumar-bd2yt 2 жыл бұрын
Nice
@paanjo10
@paanjo10 8 ай бұрын
Holy shit, this is what my boss wanted and I managed to do this because the dataset is almost similar. lmao thank you!!
@salahderdar5148
@salahderdar5148 2 жыл бұрын
That's awesome, You're a genius, guy, I'm your fan from now on 👍 But we will be thankful if you make another tutorial for multiple regression using two or three variables 🙏
@DapperDash
@DapperDash 2 жыл бұрын
Salah, thanks for the support. Yes, I am actually working on putting together a multiple variable regression tutorial. Stay tuned.
@350maybrick
@350maybrick Жыл бұрын
Thanks!
@elikyals
@elikyals 2 жыл бұрын
Congratulations, you hit a thousand before the predicted Date.
@DapperDash
@DapperDash 2 жыл бұрын
Hey! yeah I ended up reaching the goal on June 9th!. It is crazy how accurately close it was.
@sanketwagh4483
@sanketwagh4483 Жыл бұрын
Thanks for the informational tutorial. Do you know how can we show the values in %? Like in terms of trend how much is it up/down
@salmahanifah2364
@salmahanifah2364 Жыл бұрын
hi, thank you for your tutorial. can you explain how, to sum up of x variable? because x is the date. not number.
@casperselmerfrandsen9691
@casperselmerfrandsen9691 2 жыл бұрын
I have two columns, X and Y, and want to make a simple linear regression to predict Y based on X. I need to be able to apply a filter to choose selected rows based on a value in a third column, Z,. Will it be possible to do this using this method?
@marcinterlecki7744
@marcinterlecki7744 2 жыл бұрын
It's June 15 2022 and you have 1k subscribers :)
@DapperDash
@DapperDash 2 жыл бұрын
Hey Marcin! I ended up reaching the goal on June 9th. Crazy how accurately close it was. It was a fun exercise.
@nehasaxena4169
@nehasaxena4169 2 жыл бұрын
I have daily sales data but I want the linear regression by month year this is not. Giving correct result could you please help .thanks
@itzhimari8494
@itzhimari8494 Жыл бұрын
Comprehensive solution how to create regression for beginners
@user-yv2fw3cb8p
@user-yv2fw3cb8p 2 жыл бұрын
great,可以出个指数平滑法预测视频吗
@DapperDash
@DapperDash 2 жыл бұрын
I will look into Exponential Smoothing and see what I can build. It would most likely be simple exponential smoothing. Anything else may require Python or R to display.
@350maybrick
@350maybrick Жыл бұрын
A little help. Very frustrated right now. I keep getting this error. The syntax for ')' is incorrect. (DAX(var data=SELCTCOLUMNS(ALLSELECTED(DataSource), "x_values",DataSource[CloseDate], "y_values",[SalesVolume]))). This is what I have typed into the DAX Editor 1 RegressionLine = 2 3 var data = 4 5 SELECTCOLUMNS(ALLSELECTED(DataSource), 6 "x_values",DataSource[Close Date], 7 "y_values",[SalesVolume] 8 ) I have verified there is no blank data. Any help is appreciated.
@vasilikievangelou9518
@vasilikievangelou9518 Жыл бұрын
I have encountered the same problem. Did you manage to solve it?
@easy.peasey
@easy.peasey Жыл бұрын
idk what I did by my regression line is flat. Also, I am using a really bad data set so I think thats the reason.
@DapperDash
@DapperDash Жыл бұрын
EasyPeasey, my email is on the "About" section of the channel. You can send my a csv or excel file of your dataset and I can see what might be going on.
@easy.peasey
@easy.peasey Жыл бұрын
@@DapperDash I believe I figured it out. I needed to make a measure versus using quick measures. But now m regression line goes up and down versus a line. I think that is technically fine tho.
@juanarmandoarteagasabja6021
@juanarmandoarteagasabja6021 2 жыл бұрын
The analisis was correct, you are 1000 subscribers by jun!! im subscribe now!!
@DapperDash
@DapperDash 2 жыл бұрын
It was kind of interesting, I hit the goal about a day early from the video prediction. For a simple linear regression, it was scary how accurate it became.
@powerbinareal
@powerbinareal 11 ай бұрын
Muito legal! Sou do Brasil e produzo conteúdos também!
Power Bi : Use Local Images in Power Bi. 3 Different Methods
39:24
Simple Linear Regression Analysis For Beginners | Basic Predictive Analytics
10:34
Adam Finer - Learn BI Online
Рет қаралды 13 М.
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 32 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 29 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 21 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 78 МЛН
Linear Regression, Clearly Explained!!!
27:27
StatQuest with Josh Starmer
Рет қаралды 219 М.
Set Up Automatic KPI Trackers | Dynamic Alerts in Power BI Desktop
17:40
REDUCE the # of measures with Calculation Groups In Power BI
9:24
Guy in a Cube
Рет қаралды 216 М.
The New LINESTX() DAX Function in Power BI - Clearly Explained #linearregression
8:20
Multiple Regression from beginning to end in 30 minutes.
33:07
R Programming 101
Рет қаралды 11 М.
Multiple Regression in R, Step by Step!!!
7:43
StatQuest with Josh Starmer
Рет қаралды 75 М.
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 2,4 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН