Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello!
I’m a Tableau user switching over to Power BI/DAX. I’m trying to replicate a Tableau calculation I had but having trouble figuring out the best approach in Power BI/Query. I am looking for an IF Contains THEN formula for multiple instances...
Here is the calculation in Tableau:
IF CONTAINS ([Campaign Name], “XYZ”) Then “XYZ Campaign”
ELSEIF CONTAINS ([Campaign Name], “ABC”) Then “ABC Campaign”
ELSEIF CONTAINS ([Campaign Name], “JKL”) Then “JKL Campaign”
END
Thanks!
Solved! Go to Solution.
Switch(true(),
CONTAINS ([Campaign Name], “XYZ”) ,“XYZ Campaign”
CONTAINS ([Campaign Name], “ABC”) ,“ABC Campaign”
CONTAINS ([Campaign Name], “JKL”) ,“JKL Campaign”
"ELSE"
)
Switch(true(),
CONTAINS ([Campaign Name], “XYZ”) ,“XYZ Campaign”
CONTAINS ([Campaign Name], “ABC”) ,“ABC Campaign”
CONTAINS ([Campaign Name], “JKL”) ,“JKL Campaign”
"ELSE"
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
15 | |
11 | |
11 | |
10 |