Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
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"
)
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.