Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all, I have a large collection of customer emails, and I need to sort them from emails that are usable and those that are not. I have them all in one column, and I would like to search that column for text value "@" and ".com". This is because some of the values in the email column do not include these values, and so they aren't usable. For example, I want to gather all emails like
"acb1234@gmail.com"
"tiger67@yahoo.com"
"78steelers@aol.com"
And not anything else, like phone numbers, blanks, or non-email addresses. Is there a way to do this? Let me know if you need additional information, thank you
Solved! Go to Solution.
@abeirne , Sorry Syntax issue .
correct one is
if Text.Contains([Column1],"@") and Text.Contains([Column1],".com") then 1 else 0
M test code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSnRITErWS87PVYrViVZKcUgB8vJSS8C85LIkMG1oZKwUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.Contains([Column1],"@") and Text.Contains([Column1],".com") then 1 else 0)
in
#"Added Custom"
@abeirne , You can use filter in power query. USe custom option and use OR
or create a column like this
if Text.Contains("@",[Col]) or Text.Contains(".com",[Col]) then 1 else 0
and filter row having value of this column =1 in power query
if Text.Contains("@",[Customer_Email_Address]) or
Text.Contains(".com", [Customer_Email_Address]) then [Customer_Email_Address] else "BBBB"
Unfornately that is only resulting in BBBB, I am not sure why, even when I change the 'or' to 'and'.
I also have this which is semi-working:
if List.AnyTrue(List.Transform( { "@" , ".com"}, (substring) => Text.Contains( [Customer_Email_Address], substring ) ) ) = true then [Customer_Email_Address] else "BBBBBB")
How to I add "and" in this? Right now it is pulling both values, resulting in outputs like "@DENIED" and other incorrect email addresses. Thank you for your help in this.
@abeirne , Sorry Syntax issue .
correct one is
if Text.Contains([Column1],"@") and Text.Contains([Column1],".com") then 1 else 0
M test code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSnRITErWS87PVYrViVZKcUgB8vJSS8C85LIkMG1oZKwUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.Contains([Column1],"@") and Text.Contains([Column1],".com") then 1 else 0)
in
#"Added Custom"
Hi thank you very much. Is there a way I can make a list of things not to include in results, as well as including and Text.Contains([Column1],"@"), etc?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 8 | |
| 8 |