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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Multiple And conditions within text.Contains

Hi,

 

I'm trying to write a statement so that if a cell  within a specified column contains 2 or more specified strings then add value to another column

 

e.g. say I was using email To line data. If the To line (Column A) contained both "john.smith@gmail.com" and "smith.john@gmail.com" then fill Column B with "Multiple Inboxes"

 

delimiter used in this case between emails would be ";"

 

I have tried the following but does neither seem to work:

 

 

= if Text.Contains([DisplayTo], "john.smith@gmail.com") and Text.Contains([DisplayTo],"smith.john@gmail.com") then "Multiple Inboxes"
else "Not Applicable")

= if Text.Contains([DisplayTo], "john.smith@gmail.com" and "smith.john@gmail.com") then "Multiple Inboxes"
else "Not Applicable")

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I think first codes should be correct.

=
if Text.Contains([DisplayTo], "john.smith@gmail.com") and Text.Contains([DisplayTo],"smith.john@gmail.com") then "Multiple Inboxes"
else "Not Applicable"

Please make sure the specified strings in your code are correct. In my sample it works.

1.png

 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

I think first codes should be correct.

=
if Text.Contains([DisplayTo], "john.smith@gmail.com") and Text.Contains([DisplayTo],"smith.john@gmail.com") then "Multiple Inboxes"
else "Not Applicable"

Please make sure the specified strings in your code are correct. In my sample it works.

1.png

 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors