Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello - How can I use IF and Contains together when writing a dax?
So the dax should be
IF table 1 , coulmn email contains "@gmail.com" then return "Gmail" else other
Table 1
| ggg@gmail.com |
| nnn@yahoo.com |
| kkk@apple.com |
| mmmm@bananna.com |
| kkkkk@pear.com |
Solved! Go to Solution.
As a calculated column:
Gmail? = IF(CONTAINSSTRING('Table 1'[Email], "gmail"), "gmail", "Other")
As a measure:
gmail measure =
IF(CONTAINSSTRING(MAX('Table 1'[Email]), "gmail"), "gmail", "other")
Proud to be a Super User!
Paul on Linkedin.
As a calculated column:
Gmail? = IF(CONTAINSSTRING('Table 1'[Email], "gmail"), "gmail", "Other")
As a measure:
gmail measure =
IF(CONTAINSSTRING(MAX('Table 1'[Email]), "gmail"), "gmail", "other")
Proud to be a Super User!
Paul on Linkedin.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!