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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Shelley
Continued Contributor
Continued Contributor

How to Remove Multiple Substrings from a String of Text in Power Query

Hi Team,

I need to remove specific strings from the end of a string; however, not every field contains these values, so I cannot simply remove a certain number of characters from the end of the string. Here is some sample data:

Job Title

Asset Management Mgmt Level 1
Asset Management Mgmt Level 2
Asset Management Mgmt Level 3
Asset Management Mgmt Level 4
Bid Mgmt Level 2
Bid Mgmt Level 3
Bid Mgmt Level 4
Bid Specialist
Bid Specialist Level 1
Bid Specialist Level 2
Bid Specialist Level 3
Bid Specialist Level 4
Bid Specialist Level 5
Billing Administrator Level 2
Billing Administrator Level 3
Billing Administrator Level 4
Billing Administrator Level 5

 

I need to remove all instances of the following (or replace them with null):

" Level 1"

" Level 2"

" Level 3"

" Level 4"

" Level 5"

" Level 6"

 

I know I can do this one by one with six steps like the below, but is there a way to do this in one step?


= Table.ReplaceValue(#"Changed Type2", " Level 1", "", Replacer.ReplaceText,{"Job Title"})

Thanks in advance for any assistance!

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can use 

= Table.TransformColumns(#"Changed Type", {{"Job Title", each Text.BeforeDelimiter(_, " Level "), type text}})

This assumes that the word 'Level' will not appear in a job title you want to keep.





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

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Shelley
Continued Contributor
Continued Contributor

@jgeddes Good idea. Works great, thanks so much!

 

jgeddes
Super User
Super User

You can use 

= Table.TransformColumns(#"Changed Type", {{"Job Title", each Text.BeforeDelimiter(_, " Level "), type text}})

This assumes that the word 'Level' will not appear in a job title you want to keep.





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

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors