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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PowerBINoob24
Resolver I
Resolver I

Stripping characters from string

I have a number of records that have an employee's title and name.  The format is Title (Name).  Is there a way to strip all characters away except for the employee's name?

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Thanks for clarifying. You can use Extract function in Power Query Editor. Please find the code and sceenshot attached.

AbhinavJoshi_0-1690579594907.png

 


 #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Changed Type1", {{"Name", each Text.BetweenDelimiters(_, "(", ")"), type text}})

View solution in original post

So easy once you know where to look.  Thanks!

View solution in original post

4 REPLIES 4
AbhinavJoshi
Responsive Resident
Responsive Resident

Hello @PowerBINoob24. You can achieve this in Power Query Edior using split column by delimiter. First I split it using the "(", and then I do it replace values where I replace ")" with blank to get the name only. Please find the full source code ,and screenshots attached.

 

AbhinavJoshi_0-1690577742147.png

 

AbhinavJoshi_2-1690577769130.png

AbhinavJoshi_3-1690577853339.pngAbhinavJoshi_4-1690577860329.png

 

 


let
Source = Excel.Workbook(File.Contents("C:\Users\AJoshi\Downloads\Random2.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Name", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type1", "Name", Splitter.SplitTextByDelimiter("(", QuoteStyle.None), {"Name.1", "Name.2"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Name.1", type text}, {"Name.2", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type2",")","",Replacer.ReplaceText,{"Name.2"})
in
#"Replaced Value"

 

I hope it helps!

Thank you. While that works, I'm not looking to split the columns.  Just need to strip everything but the name.

Thanks for clarifying. You can use Extract function in Power Query Editor. Please find the code and sceenshot attached.

AbhinavJoshi_0-1690579594907.png

 


 #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Changed Type1", {{"Name", each Text.BetweenDelimiters(_, "(", ")"), type text}})

So easy once you know where to look.  Thanks!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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