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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kbudzynski
Regular Visitor

Grabbing email strings

Hello,

 

I have a text field that has numerous email strings in it. I want to remove everything but the email addresse(s)--(basically all strings that encompass @ and keep all characters to the spaces on each side). In some fields, there are numerous emails  Can anyone suggest a solution? I have Googled and tried many things without any luck. 

 

Many thanks for any help!

Kev

2 ACCEPTED SOLUTIONS
TheoC
Super User
Super User

Hi @kbudzynski

 

You can create a Calculated Column with the following. Just change your Table and Column name 🙂

 

TheoC_1-1633466811060.png

 

Where there is more than one email in a single text string, I'd recommend using Power Query to split up the strings so that the Calculated Column doesn't return an error, then repeat the process accordingly.

 

All the best! 🙂

Just in case screen shot is blurry, below is the Calculated Column:

 

Email Clean =
TRIM (
RIGHT (
SUBSTITUTE (
LEFT ( 'Table'[Email] ,
FIND (" ",'Table'[Email] & " " , FIND ( "@" , 'Table'[Email] ) ) -1) , " " , REPT (" " , LEN ( 'Table'[Email] ) ) ) , LEN ( 'Table'[Email] )
)
)

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

mahoneypat
Microsoft Employee
Microsoft Employee

In the query editor, you can use the Text.Split function to make a list of all the strings, using the space " " as the delimiter, and then list List.Select to keep only the list items that Text.Contain the "@" symbol.  From there, you can expand that list to new rows, or use Text.Combine to re-concatenate the email addresses with ";" or another delimiter.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
kbudzynski
Regular Visitor

Many thanks for you 3. These solutions work and many, many thanks.

mahoneypat
Microsoft Employee
Microsoft Employee

In the query editor, you can use the Text.Split function to make a list of all the strings, using the space " " as the delimiter, and then list List.Select to keep only the list items that Text.Contain the "@" symbol.  From there, you can expand that list to new rows, or use Text.Combine to re-concatenate the email addresses with ";" or another delimiter.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


TheoC
Super User
Super User

Hi @kbudzynski

 

You can create a Calculated Column with the following. Just change your Table and Column name 🙂

 

TheoC_1-1633466811060.png

 

Where there is more than one email in a single text string, I'd recommend using Power Query to split up the strings so that the Calculated Column doesn't return an error, then repeat the process accordingly.

 

All the best! 🙂

Just in case screen shot is blurry, below is the Calculated Column:

 

Email Clean =
TRIM (
RIGHT (
SUBSTITUTE (
LEFT ( 'Table'[Email] ,
FIND (" ",'Table'[Email] & " " , FIND ( "@" , 'Table'[Email] ) ) -1) , " " , REPT (" " , LEN ( 'Table'[Email] ) ) ) , LEN ( 'Table'[Email] )
)
)

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

AlexisOlson
Super User
Super User

Can you give some example inputs and outputs?

 

If you just need to remove rows that don't have an "@" symbol, things are simple. If you have strings with multiple emails that also have other text you need to remove while still retaining all of the emails, then things will be much more difficult.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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