I just finished watching your video on using VARIABLES in DAX formulas in Power BI, and I wanted to take a moment to thank you for such a beautifully and simply explained tutorial. Your clear and concise explanations made it easy to understand the concept, logic, and practical uses of variables in DAX. Thank you once again for such an insightful and easy-to-follow video.
Wow!! Thank you!! I couldn’t foe the life of me understand how to use variables and this video changed me life 💪. This was by far, the best explanation and practical guide to Variables on UA-cam. This will make my coding so much neater and less complex!
I need to make a comment to this topic. RETURN statement is not a part of a variable definition, the Variable syntax (as it is discribed in official documentation) is just like that: VAR = RETURN statement is required in the end of the DAX codeblock to make the final DAX formula that uses all the variables defined in front of it and assign this formula result to the output (table or measure or calculated cokumn).
Mikhail, Thanks for stopping by. You are correct! That's what we see for a VARIABLE definition in the Microsoft materials. However, in order to have a complete functionality, the RETURN part should be included in the whole expression, and that's what wanted to share. Defining a VARIABLE by itself, it wouldn't give me any results, but if I complement it with the RETURN part, I can definitely get an outcome. I hope this helps!
cant say more than "thank youuuu!!!" for your tutorial! it's soo helpful ^^ i was confused for the function of VAR in DAX, especially when another tutors video are not explaining the meaning of Return and MyVariable (the green one). Thank you, great explanations!
Hi Nestor, thank you for a great video! Very helpful. You are very good at explaining this subject. I have a question regarding the TV profit part - is it no so that the filterering you are doing when using CALCULATE, could also be done using a FILTER function witin the CALCULATE function - or what is the difference using it or not?
@sunenielsen, Thanks for your feedback. You are correct, you can also use the FILTER function as part of the filter argument within CALCULATE. Filters arguments within CALCULATE are actually table expressions, so by using the FILTER function, you will be using the explicit way of a filter argument. I hope that helps! Cheers!
@@NestorAdrianzen Thanks for your reply. That makes sense to regard it as the explicit way - I did not know I could do without before watching your video. So know I wonder when functions in Power BI can be left out and only used to make something more explicit? Is this the only case?
Hi. Loved the video. One question though. Why create three variables in the examples, then return the last one in the return statement. Why not just create the first two then put the third as the return statement? Thanks
Hi there, thanks for the video, seems pretty nice and clear. Just one question: why would I use variables to calculate the Total Profit - in fact I have the following options: 1. Create calculated column by deducting Premium Claim - Total Cost, 2. Create a measure deducting Premium Claim - Total Cost, 3. Create a var measure the way you've done it. Where should I use which option? Thank you, Luke
Luke, thanks for your question. You are correct, we could have found Total Profit by using the first and second options described above as well. I decided to use the variables for illustrative purposes. However, here are a couple of details to be aware of: If we have large datasets and this data needs to be refreshed quite often, we would want to use measures over calculated columns to save memory and disk space. Also, we should avoid calculated columns as intermediate calculations for a measure. Finally, because variables improve code readability and performance, we would want to use variables in measures that involve more complex formulas. I hope it helps. Thanks!
Great videos!! Thank you!
Thanks, Camila! Glad you found the content helpful. Stay tuned for more lessons.
I just finished watching your video on using VARIABLES in DAX formulas in Power BI, and I wanted to take a moment to thank you for such a beautifully and simply explained tutorial. Your clear and concise explanations made it easy to understand the concept, logic, and practical uses of variables in DAX. Thank you once again for such an insightful and easy-to-follow video.
Glad it helped!
Wow!! Thank you!! I couldn’t foe the life of me understand how to use variables and this video changed me life 💪. This was by far, the best explanation and practical guide to Variables on UA-cam. This will make my coding so much neater and less complex!
Glad to hear that. Cheers 🥂
Boom!! I learned about VAR guys!! Great!!
Great to hear!
Understood Variables finally !!!!
Mihir Thakkar, Excellent! Glad you found the content helpful!👍
Thank you Nestor ! Great lesson, you explain it simple and clearly.
Glad you liked it! Keep it up, Imperial Palace!
I need to make a comment to this topic.
RETURN statement is not a part of a variable definition,
the Variable syntax (as it is discribed in official documentation) is just like that:
VAR =
RETURN statement is required in the end of the DAX codeblock to make the final DAX formula that uses all the variables defined in front of it and assign this formula result to the output (table or measure or calculated cokumn).
Mikhail, Thanks for stopping by. You are correct! That's what we see for a VARIABLE definition in the Microsoft materials. However, in order to have a complete functionality, the RETURN part should be included in the whole expression, and that's what wanted to share. Defining a VARIABLE by itself, it wouldn't give me any results, but if I complement it with the RETURN part, I can definitely get an outcome. I hope this helps!
cant say more than "thank youuuu!!!" for your tutorial! it's soo helpful ^^ i was confused for the function of VAR in DAX, especially when another tutors video are not explaining the meaning of Return and MyVariable (the green one). Thank you, great explanations!
Glad to hear that. Cheers!😃
Thanks, I finally got it.
Glad it helped! Cheers 👍
Very nice and helpful
Glad you found it helpful. Cheers 👍
Boom! Thank you Nestor
💥 Boom. Thanks for stopping by, SuperShiva!
great video to explain the basics
Glad it was helpful!
Thanks! this is really a very simple to understand and effective.
Glad it was helpful!
Outstanding explanation...really enjoying your channel
Glad you enjoy it! Cheer!
Great video..!! Easy to lean DAX and Variables if you explain in this way..thanks a lot..
Excellent! Keep up the good work, Vishnu Rao!
Very well explained, thanks.
Glad it was helpful! Cheers!
Thank you very much - highly appreciated
Glad it helped
@@NestorAdrianzen tq so much for patients to explain the things called varble
Awesome...bring more examples for variables
Will do! Keep it up, Hems Rajani👍
Hi Nestor, thank you for a great video! Very helpful. You are very good at explaining this subject. I have a question regarding the TV profit part - is it no so that the filterering you are doing when using CALCULATE, could also be done using a FILTER function witin the CALCULATE function - or what is the difference using it or not?
@sunenielsen,
Thanks for your feedback. You are correct, you can also use the FILTER function as part of the filter argument within CALCULATE.
Filters arguments within CALCULATE are actually table expressions, so by using the FILTER function, you will be using the explicit way of a filter argument.
I hope that helps!
Cheers!
@@NestorAdrianzen Thanks for your reply. That makes sense to regard it as the explicit way - I did not know I could do without before watching your video. So know I wonder when functions in Power BI can be left out and only used to make something more explicit? Is this the only case?
Nicely explained
Thanks for your support, Raushan!👍
Thanks ..Great video
Ridzal, Thanks for stopping by. Keep up the great work!
Very useful videos
Excellent!
Nice, thank you for this video
Glad it helped!
Nice vedio, can you say I went fetch sales value having the date 1-3-2015 ,
,which Dax should be used ?
Raju Alex, Thanks for stopping by. Could you please share more details about your question so I can provide you with a better explanation? Cheers!
Cuando llegaste a los gráficos con barras, me perdí, esperaré la versión en español para entenderla mejor, 😎😎
Grover, Acabo de publicar la versión en español. Aquí está el link: ua-cam.com/video/FBhQizFTpIU/v-deo.html
BOOM!
You got it! Boom💥
Hi. Loved the video. One question though. Why create three variables in the examples, then return the last one in the return statement. Why not just create the first two then put the third as the return statement?
Thanks
Eric Landry, thanks for stopping by. Yes, that’s also possible.
Great!!
Thanks for stopping by, Giorgos. Keep it up 👍
Here is the content link: drive.google.com/file/d/1Kkwn3Xu9SvxGHB3ak5HveYpuf9F1XFg8/view?usp=sharing
Hi there, thanks for the video, seems pretty nice and clear. Just one question: why would I use variables to calculate the Total Profit - in fact I have the following options:
1. Create calculated column by deducting Premium Claim - Total Cost,
2. Create a measure deducting Premium Claim - Total Cost,
3. Create a var measure the way you've done it.
Where should I use which option?
Thank you,
Luke
Luke, thanks for your question. You are correct, we could have found Total Profit by using the first and second options described above as well. I decided to use the variables for illustrative purposes. However, here are a couple of details to be aware of: If we have large datasets and this data needs to be refreshed quite often, we would want to use measures over calculated columns to save memory and disk space. Also, we should avoid calculated columns as intermediate calculations for a measure. Finally, because variables improve code readability and performance, we would want to use variables in measures that involve more complex formulas. I hope it helps. Thanks!
besto
Glad you found it helpful, Snehal!
In spanish, please
Carlos, thanks for your request. I'll publish the Spanish version this upcoming Saturday. Stay tuned!
I just posted the Spanish version. Here is the link: ua-cam.com/video/FBhQizFTpIU/v-deo.html
hi bro i got a job on power bi with sql on support project if i get any doubts can i contact you, please give me your email i will post my doubts,..