How to Use VARIABLES in Dax Formulas in Power BI

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ •

  • @camilacifuentes6739
    @camilacifuentes6739 4 роки тому +1

    Great videos!! Thank you!

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Thanks, Camila! Glad you found the content helpful. Stay tuned for more lessons.

  • @xeeshanahmad8757
    @xeeshanahmad8757 5 місяців тому

    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.

  • @jreyescruz
    @jreyescruz Рік тому

    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!

  • @sarigoppulavinay5003
    @sarigoppulavinay5003 3 роки тому +1

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

  • @mihirthakkar6902
    @mihirthakkar6902 3 роки тому +1

    Understood Variables finally !!!!

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Mihir Thakkar, Excellent! Glad you found the content helpful!👍

  • @imperialpalace9926
    @imperialpalace9926 3 роки тому +2

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

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Glad you liked it! Keep it up, Imperial Palace!

  • @mvdyakonov
    @mvdyakonov 3 роки тому

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

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      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!

  • @shonyamarpaung1842
    @shonyamarpaung1842 Рік тому

    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!

  • @jannonflores1113
    @jannonflores1113 2 роки тому

    Thanks, I finally got it.

  • @prasantaseth4733
    @prasantaseth4733 Рік тому

    Very nice and helpful

  • @SuperShiva2012
    @SuperShiva2012 2 роки тому

    Boom! Thank you Nestor

    • @NestorAdrianzen
      @NestorAdrianzen  2 роки тому

      💥 Boom. Thanks for stopping by, SuperShiva!

  • @tubeitz
    @tubeitz 4 роки тому +1

    great video to explain the basics

  • @AjayKumar-uf7ux
    @AjayKumar-uf7ux 2 роки тому

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

  • @irfanabbassi9202
    @irfanabbassi9202 2 роки тому

    Outstanding explanation...really enjoying your channel

  • @vishnurao2901
    @vishnurao2901 3 роки тому

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

  • @kamransamad9686
    @kamransamad9686 2 роки тому

    Very well explained, thanks.

  • @midsummer4864
    @midsummer4864 4 роки тому

    Thank you very much - highly appreciated

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Glad it helped

    • @sachinbudke8429
      @sachinbudke8429 3 роки тому

      @@NestorAdrianzen tq so much for patients to explain the things called varble

  • @hemarajani2711
    @hemarajani2711 3 роки тому

    Awesome...bring more examples for variables

  • @sunenielsen2686
    @sunenielsen2686 Рік тому

    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?

    • @NestorAdrianzen
      @NestorAdrianzen  Рік тому +1

      @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!

    • @sunenielsen2686
      @sunenielsen2686 Рік тому

      @@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?

  • @raushankumarpandey897
    @raushankumarpandey897 2 роки тому

    Nicely explained

  • @ridzal7901117
    @ridzal7901117 3 роки тому

    Thanks ..Great video

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Ridzal, Thanks for stopping by. Keep up the great work!

  • @suryaphaneendra8523
    @suryaphaneendra8523 3 роки тому

    Very useful videos

  • @gangababupatchipala3728
    @gangababupatchipala3728 4 роки тому

    Nice, thank you for this video

  • @raju__AYU
    @raju__AYU 3 роки тому

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

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      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!

  • @revorg23
    @revorg23 4 роки тому +2

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

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому

      Grover, Acabo de publicar la versión en español. Aquí está el link: ua-cam.com/video/FBhQizFTpIU/v-deo.html

  • @vmcostaferreira
    @vmcostaferreira 2 роки тому +1

    BOOM!

  • @ericlandry3971
    @ericlandry3971 3 роки тому

    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

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Eric Landry, thanks for stopping by. Yes, that’s also possible.

  • @giorgosi.fovakis8810
    @giorgosi.fovakis8810 3 роки тому

    Great!!

    • @NestorAdrianzen
      @NestorAdrianzen  3 роки тому

      Thanks for stopping by, Giorgos. Keep it up 👍

  • @NestorAdrianzen
    @NestorAdrianzen  4 роки тому

    Here is the content link: drive.google.com/file/d/1Kkwn3Xu9SvxGHB3ak5HveYpuf9F1XFg8/view?usp=sharing

  • @lg99891
    @lg99891 4 роки тому +1

    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

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +5

      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!

  • @snehalgawari4258
    @snehalgawari4258 4 роки тому

    besto

  • @carlosalvarezsolis7201
    @carlosalvarezsolis7201 4 роки тому +2

    In spanish, please

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +2

      Carlos, thanks for your request. I'll publish the Spanish version this upcoming Saturday. Stay tuned!

    • @NestorAdrianzen
      @NestorAdrianzen  4 роки тому +1

      I just posted the Spanish version. Here is the link: ua-cam.com/video/FBhQizFTpIU/v-deo.html

  • @sravankumar1767
    @sravankumar1767 4 роки тому

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