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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cannellonigreyh
Frequent Visitor

How to remove multiple email addresses

Hello. 

 

A field (emailBody) contains the body/text of certain emails we have received. 

In Power Query, I need to remove/obscure email addresses for data protection reasons. 

One entry can contain multiple email addresses. 

 

I've found this solution here

 

 

= Text.Combine(List.Select(Text.Split([Name], " "), each not(Text.Contains(_, "PL"))), " ")

 

 

...but I understand this would only work for one email address for each entry. 

 

How can I remove any string that is like '*@*' ?

 

1 ACCEPTED SOLUTION

@cannellonigreyh You can use this:

AddedCustom = 
    Table.AddColumn ( 
        PreviousStep, 
        "New Text", 
        each 
        Text.Combine ( 
            List.Select ( 
                Text.Split ( [Text], " " ), 
                each not Text.Contains ( _, "@" ) 
            ), 
            " " 
        ), 
        type text 
    )

AntrikshSharma_0-1669286442910.png

View solution in original post

4 REPLIES 4
cannellonigreyh
Frequent Visitor

You really are a Rockstar, @AntrikshSharma 

AntrikshSharma
Super User
Super User

@cannellonigreyh Share sample data.

Input: 

Row 1: Hi my name is Tom and my email address is Tom@Tomtom.com I would like to discuss the price of brake fluid. 

Row 2: My brother's email address is Steve@toast.com and mine is SueBlue@pretenddomain.com and I am very happy because biscuits exist. 

 

Output: 

Row 1: Hi my name is Tom and my email address is I would like to discuss the price of brake fluid. 

Row 2: My brother's email address is  and mine is  and I am very happy because biscuits exist. 

 

 

@cannellonigreyh You can use this:

AddedCustom = 
    Table.AddColumn ( 
        PreviousStep, 
        "New Text", 
        each 
        Text.Combine ( 
            List.Select ( 
                Text.Split ( [Text], " " ), 
                each not Text.Contains ( _, "@" ) 
            ), 
            " " 
        ), 
        type text 
    )

AntrikshSharma_0-1669286442910.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.