We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
Solved! Go to Solution.
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!
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
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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 41 | |
| 34 | |
| 25 |