Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi Folks
I have various columns where name values are held in the form of an email Title in the following format:
Lastname, Firstname (Department)
I want to reformat to: Firstname Lastname
(so stripping out the brackets and text in them, changing order to have Firstname first, and removing the comma).
What's the best way to do this?
Thanks
Solved! Go to Solution.
Hi @SteveMForm
Do the Values look like this Barry, Joe (BI) ?
In Power Query, try the following
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckosKqrUUfDKT1XQcPLUVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Email." = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Email.", type text}}),
#"Inserted Text After Delimiter" = Table.AddColumn(#"Changed Type", "Text After Delimiter", each Text.AfterDelimiter([#"Email."], ", "), type text),
#"Inserted Text Before Delimiter" = Table.AddColumn(#"Inserted Text After Delimiter", "Text Before Delimiter", each Text.BeforeDelimiter([#"Email."], ","), type text),
#"Inserted Text After Delimiter1" = Table.AddColumn(#"Inserted Text Before Delimiter", "Text After Delimiter.1", each Text.AfterDelimiter([Text After Delimiter], " "), type text),
#"Inserted Text Before Delimiter1" = Table.AddColumn(#"Inserted Text After Delimiter1", "Text Before Delimiter.1", each Text.BeforeDelimiter([Text After Delimiter], " "), type text),
#"Merged Columns" = Table.CombineColumns(#"Inserted Text Before Delimiter1",{"Text Before Delimiter.1", "Text Before Delimiter"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
#"Merged Columns"
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Hi @Joe_Barry - I used your method and all worked fine.
BTW- stupid question, but once I have created the merged column, and deleted the 'intermediary' ones, the merged column will produce the desired format with new data entries?
@Anonymous will try your method on next table - so thnaks for providing an alternate method.
Thanks for the reply from @Joe_Barry , please allow me to provide another insight:
Hi @SteveMForm ,
You can try below formula to create calculated column:
FormattedName =
VAR FullName = Employees[EmailTitle]
VAR CommaPosition = FIND(",", FullName, 1, LEN(FullName))
VAR FirstName = MID(FullName, CommaPosition + 2, FIND("(", FullName, CommaPosition) - CommaPosition - 3)
VAR LastName = LEFT(FullName, CommaPosition - 1)
RETURN FirstName & " " & LastName
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SteveMForm
Do the Values look like this Barry, Joe (BI) ?
In Power Query, try the following
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckosKqrUUfDKT1XQcPLUVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Email." = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Email.", type text}}),
#"Inserted Text After Delimiter" = Table.AddColumn(#"Changed Type", "Text After Delimiter", each Text.AfterDelimiter([#"Email."], ", "), type text),
#"Inserted Text Before Delimiter" = Table.AddColumn(#"Inserted Text After Delimiter", "Text Before Delimiter", each Text.BeforeDelimiter([#"Email."], ","), type text),
#"Inserted Text After Delimiter1" = Table.AddColumn(#"Inserted Text Before Delimiter", "Text After Delimiter.1", each Text.AfterDelimiter([Text After Delimiter], " "), type text),
#"Inserted Text Before Delimiter1" = Table.AddColumn(#"Inserted Text After Delimiter1", "Text Before Delimiter.1", each Text.BeforeDelimiter([Text After Delimiter], " "), type text),
#"Merged Columns" = Table.CombineColumns(#"Inserted Text Before Delimiter1",{"Text Before Delimiter.1", "Text Before Delimiter"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
#"Merged Columns"
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more