Power BI: Use DAX Switch Function to Make IF Functions Easier
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
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.
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.
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!
Glad it helped!
7:00 With SWITCH use TRUE() to evaluate conditions; instead of nested DAX IF statements.
Great tip!
YOU ARE A GREAT TEACHER ! THANK YOU
Excellent explanatio. Very detailed!! Thanks a lot!
Brilliant video, so easily to follow.
Excellent explanation! Many thanks for sharing!
You're welcome! Glad you enjoyed it!
Good explanation
Thank you so much. This video is very useful. Keep making such video
Thank you!!
very helpful, thank you
This guy explains really well! Thank you
Thank you Martin, we are glad you think so!
Very helpful sir, thanks for the effort
Most welcome!
Fantasttic!!!!!! Got mi Power BI rolling....!
Glad you enjoyed!
nice video! very useful and concise
Glad it was helpful! Thanks for watching!
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.
I love a good non-sales-related DAX example.
Superb
Very helpful
Glad to hear that
Great tip, especially on how to use expressions instead of constant values!
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.
Suppose i want sorting order of 20 unique customers names in column ( 100000 rows ) by using calculated column. How is that ..
Show!
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..
How about conditional columns easier way right?
¿Se puede combinar SWITH con IF o con otro SWITH ?
Switch time = IF( x < 5, 1-x/10) ? there x= Missed Chores
Joke had me in stiches