Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I'm tryting to format:
tim_cook_apple.com ==> tim_cook@apple.com
Background
a ShareGate data report displays all external accounts in SPO as "i:0#.f|membership|tim_cook_apple.com#ext#@apple.onmicrosoft.com", which I am trying to extract the user Email from.
After some transforming I got the string to trim into "tim_cook_apple.com".
I am trying to reference the first underscore from the right and then use the substitute function to replace the underscore with @. However the search, find functions always targets the first instance from the left. How can I reference the first instance fo the underscore from the right?
Thank you
Solved! Go to Solution.
@IMCODEV Try this:
New Column =
VAR __Num = LEN([Column]) - LEN(SUBSTITUTE([Column],"_",""))
RETURN
SUBSTITUTE([Column],"_","@",__Num)
@IMCODEV Try this:
New Column =
VAR __Num = LEN([Column]) - LEN(SUBSTITUTE([Column],"_",""))
RETURN
SUBSTITUTE([Column],"_","@",__Num)
The error was caused from entries that were not in Email format. Therefore the entries had no underscore which resulted in a 0 value being returned for the _num value. As a workaround, I just created another column using the subsitiution function to swap the 0 for a valid value of 1. Afterwards, the formula which @Greg_Deckler worked and I achieved my goal.
Thank you
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |