Power BI: Use DAX Switch Function to Make IF Functions Easier

Sdílet
Vložit
  • čas přidán 12. 04. 2021
  • The SWITCH function allows for an easier-to-read function compared to nested IF statements. The SWITCH function can always be used in place of the IF function. The basic workings of the SWITCH function are you decide what expression you want to be checked. Then you decide what value to look for and what result you want to be returned. If you have multiple values to check for and multiple results you can just string them along by using commas.
    If you enjoy this video or any of my other videos and are interested in formal training on Power BI, Power Apps, Azure, or other Microsoft products you can use my code "Matt20" to get an extra of 20% off at check out when purchasing our On-Demand Learning classes from pragmaticworks.com/pricing/​ #MatthewPeterson​
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - -
    Next step on your journey:
    👉 On-Demand Learning Courses FREE Trial: www.pragmaticworkstraining.co...
    🔗Pragmatic Works On-Demand Learning Packages: pragmaticworks.com/pricing/
    🔗Pragmatic Works Boot Camps: pragmaticworks.com/boot-camps/
    🔗Pragmatic Works Hackathons: pragmaticworks.com/private-tr...
    🔗Pragmatic Works Virtual Mentoring: pragmaticworks.com/virtual-me...
    🔗Pragmatic Works Enterprise Private Training: pragmaticworks.com/private-tr...
    🔗Pragmatic Works Blog: blog.pragmaticworks.com/
    Let's connect:
    ✔️Twitter: / pragmaticworks
    ✔️Facebook: / pragmaticworks
    ✔️Instagram: / pragmatic.works
    ✔️LinkedIn: / pragmaticworks
    ✔️CZcams: / pragmaticworks
    Pragmatic Works
    7175 Hwy 17, Suite 2 Fleming Island, FL 32003
    Phone: (904) 413-1911
    Email: training@pragmaticworks.com

Komentáře • 36

  • @danielrafferty4108
    @danielrafferty4108 Před rokem +2

    Thanks for this. I am currently doing a dashboard where 23 different code names are used for work accounts and now my boss wants me to give the actual names for these values with the data I have. First thing I thought when I saw the if statement in there was "Oh no, please tell me I don't need to nest all these statements." searched PowerBi dax switch statment and your video was top of the list here. Thanks for quick example! Will be much easier to implement! I'm sure your second measure will come in handy too, the account i'm working on is a bit cowboy with it's support and i'm the only one working on anlytics through Dashboard applications like PowerBI at the moment. I can forsee needing something like this in the future.

  • @Bhatp9
    @Bhatp9 Před rokem

    Thank you, your videos are invaluable. I must say though that I had to use double quotes even for numeric outputs in the Results value for multiple IF functions.

  • @tianabryant8124
    @tianabryant8124 Před 2 lety +1

    Thank you! I've subscribed - your explanation helped me to FINALLY make sense of this function for a class I'm taking (after two days). I'm new to DAX and Power BI and your breakdown was much appreciated!

  • @wapta
    @wapta Před rokem

    7:00 With SWITCH use TRUE() to evaluate conditions; instead of nested DAX IF statements.
    Great tip!

  • @phinduloneluheni2650
    @phinduloneluheni2650 Před 2 lety +1

    YOU ARE A GREAT TEACHER ! THANK YOU

  • @xyclos
    @xyclos Před rokem

    Excellent explanatio. Very detailed!! Thanks a lot!

  • @abhinavdiwakar1308
    @abhinavdiwakar1308 Před rokem

    Brilliant video, so easily to follow.

  • @ItsWithinYou
    @ItsWithinYou Před 2 lety +1

    Excellent explanation! Many thanks for sharing!

  • @prudhvireddy6452
    @prudhvireddy6452 Před 3 lety +1

    Good explanation

  • @yasinnadaf2974
    @yasinnadaf2974 Před rokem +1

    Thank you so much. This video is very useful. Keep making such video

  • @ahmedismailbinamrai1080

    very helpful, thank you

  • @martinfernandezcean
    @martinfernandezcean Před 8 měsíci

    This guy explains really well! Thank you

  • @sonpurkesone4072
    @sonpurkesone4072 Před rokem +1

    Very helpful sir, thanks for the effort

  • @CRAM1REZ51
    @CRAM1REZ51 Před 2 lety +1

    Fantasttic!!!!!! Got mi Power BI rolling....!

  • @Alberto-dx2sw
    @Alberto-dx2sw Před rokem +1

    nice video! very useful and concise

  • @sopauljauck4163
    @sopauljauck4163 Před rokem

    just stumbled to your channel. sub. Thank you. Question. Can I use SWITCH on multiple measures at the same time? That's the dilemma i'm in right now.

  • @erinfield1943
    @erinfield1943 Před měsícem

    I love a good non-sales-related DAX example.

  • @robertravinath6365
    @robertravinath6365 Před rokem +1

    Superb

  • @fernandobo9231
    @fernandobo9231 Před 2 lety

    Very helpful

  • @ukaszlachmider5961
    @ukaszlachmider5961 Před rokem

    Great tip, especially on how to use expressions instead of constant values!

  • @goput7538
    @goput7538 Před rokem

    Nice explanation.
    Would you add, how to combine Swith(true) functions with Min & Max. For ex : The results after multiplier must with MIN and MAX. Need a help.

  • @venkatareddykummitha5863

    Suppose i want sorting order of 20 unique customers names in column ( 100000 rows ) by using calculated column. How is that ..

  • @demaxsuelmarques6382
    @demaxsuelmarques6382 Před 2 lety

    Show!

  • @channelino24
    @channelino24 Před 4 měsíci

    Great, learned it. How to use SWITCH with a list of text values? I tried it with IN bit didnt work .. if anyone has an idea, please let me know..

  • @mohammedshajith4013
    @mohammedshajith4013 Před rokem

    How about conditional columns easier way right?

  • @fernandol1611
    @fernandol1611 Před 5 měsíci

    ¿Se puede combinar SWITH con IF o con otro SWITH ?

  • @tisseract
    @tisseract Před rokem

    Switch time = IF( x < 5, 1-x/10) ? there x= Missed Chores

  • @kiroshengovender9791
    @kiroshengovender9791 Před rokem

    Joke had me in stiches