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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Searching a column for part of text

I've seen a few suggestions but none of them are working. 

 

I want to create a calculated column, searching another column containing email addresses for text string "@company"

So I was thinking of a 'CONTAINS' argument or similar. 

 

Attached image is my desired result. 

 

The purpose of this is so I can identify work email addresses. 

Example.png

 

Thanks in advance for any suggested DAX!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

use the below calculation by creating new column

Company Email = if(ISERROR(SEARCH("company",Sheet1[Email])),"N","Y")
 
Output: Email Search-Company.PNG

Accept this as solutions if it works for you.

 

Regards

Harsha

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi,

 

use the below calculation by creating new column

Company Email = if(ISERROR(SEARCH("company",Sheet1[Email])),"N","Y")
 
Output: Email Search-Company.PNG

Accept this as solutions if it works for you.

 

Regards

Harsha

 

Anonymous
Not applicable

Well what do you know @Anonymous it worked perfectly.

 

Thank you!!!!!

Anonymous
Not applicable

you could try using the split column functionality in the query editor to seperate what is before and after the '@' , then create the calculated column with your desired result. 

Anonymous
Not applicable

I'm hopeful I can find a DAX measure that will be able to look within a text string for specific text, but if it transpires this isn't possible I guess I can start splitting the column. 

Thanks for the suggestion!

Hey,

 

I have a table that contains all the email domains that make an email private, this table looks like this and is called searchphrases:

image.png

 

I also have a table that contains a column with email addresses, this table is called "look at" and looks like this:

image.png

 

I use this DAX to create a calculated column in the table "look at":

is company email = 
var findwithin = 'look at'[email]
var findthese = VALUES('searchphrases'[searchphrase])
var found = 
    SUMX(
        findthese
        , var findthis = [searchphrase]
        return
        IF(FIND(findthis , findwithin , 1 , 0) = 0
            , BLANK()
            , 1
        )
    )
return
IF(ISBLANK(found) , "Y" , "N") 

Then the table "look at" will look like this:

image.png

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.