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
Haz
New Member

Email address in string

Hi ,

 

Can someone advise me how can i obtain the email address from this string using Powerbi DAX ?

 

[{"displayName":null,"modifiedProperties":[],"userPrincipalName":"murray.mclaren@abc.com","id":"ecf6f9a6-1bca-4733-a9a6-623071a5c416"}]

 

 

1 REPLY 1
PattemManohar
Community Champion
Community Champion

@Haz Please try this.. I've intentionally made it into different steps so that it will be easy to debug and for understanding as well.

 

Email = 
VAR _Search1 = SEARCH("userPrincipalName",Test53StrExtraction[Data])
VAR _SearchVal1 = MID(Test53StrExtraction[Data],_Search1,LEN(Test53StrExtraction[Data]))
VAR _Search2 = SEARCH(":",_SearchVal1)
VAR _SearchVal2 = MID(_SearchVal1,_Search2+2,LEN(_SearchVal1))
VAR _Search3 = SEARCH(",",_SearchVal2)
RETURN MID(_SearchVal2,1,_Search3-2)

image.png

 

I suggest to transform all these kind of data in Power Query rather in DAX.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




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.