Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

IF AND

Hi,

 

Where in Excel you can have 3 parameters passed to the IF AND function, what would you recommend to use in DAX as it only allows 2?

 

Would it be Switch, or something else?

 

Thanks

 

Liam

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Try using SWITCH () function

 

SWITCH(
TRUE(),

Table[Column1]  = "A", "Returns A",

Table[Column1]  = "B", "Returns B",

Table[Column1]  = "C", "Returns C",

"others"

)

 

You can have a look at the videos.

https://www.youtube.com/watch?v=-ykkaAtlCMc&vl=en

https://www.youtube.com/watch?v=UsAJPIANAb8

 

 

For Nested IFs

 

https://www.youtube.com/watch?v=rXDomxfoY1o

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Anonymous ,

 

You can use nested IF-ELSE statement in DAX or SWITCH function.

IF-ELSE: https://docs.microsoft.com/en-us/dax/if-function-dax

SWITCH: https://radacad.com/write-conditional-statement-using-switch-in-dax-and-power-bi

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Try using SWITCH () function

 

SWITCH(
TRUE(),

Table[Column1]  = "A", "Returns A",

Table[Column1]  = "B", "Returns B",

Table[Column1]  = "C", "Returns C",

"others"

)

 

You can have a look at the videos.

https://www.youtube.com/watch?v=-ykkaAtlCMc&vl=en

https://www.youtube.com/watch?v=UsAJPIANAb8

 

 

For Nested IFs

 

https://www.youtube.com/watch?v=rXDomxfoY1o

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

Anonymous
Not applicable

thankyou @harshnathani 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.