From the course: Excel Business Intelligence: Power Pivot and DAX

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Switch and Switch (TRUE)

Switch and Switch (TRUE)

- [Instructor] Alright, next up we've got two functions that you probably haven't seen before. Switch and a variation of switch called switch true. Now, the official definition of the switch function sounds like this. It evaluates an expression against a list of values and returns one of multiple possible result expressions. Now, I don't understand that either. That's straight from Microsoft. I think they make it sound much more complicated than it really is. And the thing is when we look at the formal syntax of the function, it's still a little bit confusing. So, it starts with an expression, and that expression can be any DAX expression that returns a single scalar value, evaluated multiple times. So, still kind of overly complicated here. And in the context that we're gonna use switch, in the context that most people use switch, that expression can simply be a column name. So, like Calendar_Lookup[month_num] or Product_Lookup[product_brand]. And then from there you've got these…

Contents