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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PuddleRunna
Advocate I
Advocate I

Custom column that returns main eMail adress based on similar values

Hi all,

 

Coudln't even come up with a proper subject for this 🙈 I've been stuck on this for ages.

 

I have a table "Employees" looking like this:

First NameNameeMailDepartment
Jane Doejane.doe@company.comXyz
Jane Doe_secjane.doe_sec@company.comSec
JohnMillerjohn.miller1@company.comZyx
JohnMiller_secjohn.miller_sec@company.comSec
JackJonesjack.jones01@company.comAbc
JackJones_secjack.jones_sec@company.comSec
MelvinDoemelvin.doe@company.comEdf
KevinDoeKevin.doe@company.comGhi

 

 

Some employees have a secondary profile marked by *_sec*. I have reports on the _sec users (using site filter "contains: *_sec@company.com"). What I need is to be able to get the _sec users main eMail and department, i.e.

Jack Jones_sec maps to jack.jones01@company.com and Department Abc.

 

The difficulty here is that main adresses could include numbers at the end, so simply removing the _sec part doesn't do the trick.

I've tried duplicating the table and create a custom column for "Name" that removes the _sec part. Then mapped "Name" to 'Employees[Name] but that doesn't really work as there's several Doe's etc.

 

Appreciate any hints and tips 🙂

4 REPLIES 4
Anonymous
Not applicable

For accuracy you would really need some type of unique identifier that is shared amount the main and seconday profile. The example in your post appears to show that there is no way to when a user's main email address has numbers at the end.

Yeah, exactly my problem. It's a 60k records database list though, so my chances of getting that indicator are slim to none 😞

amitchandak
Super User
Super User

@PuddleRunna , Try new column like

 

new Department =
var _email = SUBSTITUTE([eMail], "_sec", "") // or use SUBSTITUTE([eMail], "_sec@", "@")
return
if(search("_sec", [eMail],,0) >0 , maxx(filter(Table, [eMail] =_email),[Department]),[Department])

Thanks a lot, Amit! This at least solves my problem for eMails that do not have numbers, which is the majority in this special case 🙂

 

Is there any way to make it look for eMail adresses that contain the substituted string and return the results?

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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