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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
KelliKnitsAlot
Helper II
Helper II

Replacing Text at Beginning of String

Good morning! I need to replace text at the beginning of a string. I cannot use the REPLACE VALUES function because I have the same text in other cells. I tried using Text.TrimStart in M query but either get an error or just "DIR". See example of data below. End result needed would be ABCD, EFG, HIJK, LMNO DIRECTORATE 2, etc....... 

String.PNG

 

 

 

 

 

Any assistance would be appreciated.

1 ACCEPTED SOLUTION
freginier
Solution Specialist
Solution Specialist

Create custom column in Power Query

if Text.StartsWith([Column1], "DIR") then Text.AfterDelimiter([Column1]," ") else [Column1]

View solution in original post

2 REPLIES 2
freginier
Solution Specialist
Solution Specialist

Create custom column in Power Query

if Text.StartsWith([Column1], "DIR") then Text.AfterDelimiter([Column1]," ") else [Column1]

Thank you!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.