How to Use VARIABLES in Dax Formulas in Power BI

preview_player
Показать описание
How to Use VARIABLES in Dax Formulas in Power BI/

In this tutorial, we will learn about how to create variables as part of DAX measures in Power BI. We will learn the basic syntax of a variable and finally will have two practical cases to create variables as part of DAX measures.
_______________
Highly recommended Power BI books:
(As an Amazon Associate, I earn from qualifying purchases)
_______________

Navigate through the content below:
- Content 0:29
- Understanding Variables in Power BI 1:01
- Syntax 2:16
- Uses of variables 3:34
- Practical cases 5:10

Please follow us on:

Leave your comments and questions below!
Don't forget to subscribe!
Thanks so much!

#vizxlization #variables #DAX #PowerBI
Рекомендации по теме
Комментарии
Автор

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.

xeeshanahmad
Автор

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 YouTube. This will make my coding so much neater and less complex!

jreyescruz
Автор

Boom!! I learned about VAR guys!! Great!!

sarigoppulavinay
Автор

Thank you Nestor ! Great lesson, you explain it simple and clearly.

imperialpalace
Автор

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 <name> = <expression>

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).

mvdyakonov
Автор

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!

shonyamarpaung
Автор

Thanks! this is really a very simple to understand and effective.

AjayKumar-ufux
Автор

Great video..!! Easy to lean DAX and Variables if you explain in this way..thanks a lot..

vishnurao
Автор

Outstanding explanation...really enjoying your channel

irfanabbassi
Автор

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
Автор

Thank you very much - highly appreciated

midsummer
Автор

Awesome...bring more examples for variables

hemarajani
Автор

Cuando llegaste a los gráficos con barras, me perdí, esperaré la versión en español para entenderla mejor, 😎😎

revorg
Автор

Nice vedio, can you say I went fetch sales value having the date 1-3-2015,
, which Dax should be used ?

raju__AYU
Автор

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

ericlandry
Автор

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

lg
Автор

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, ..

sravankumar