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
Janica123
Helper I
Helper I

Conditional deletion of prefixes in one column

Hello All, 

 

I have the following problem:

In one column (column1) I have entries with a certain prefix ($:#:de:) as well as entries without a prefix. Now I would like to delete only the prefixes so that I get a result like the one in column 2.

Janica123_1-1699879329520.png

Is there a way to do this in Power Query?

2 REPLIES 2
Subash_Govind
Frequent Visitor

Hi Janica123,

Below M code for the prefix removing.

 

Table.ReplaceValue(#"Changed Type","$:#:de:","",Replacer.ReplaceText,{"Column1"})

AlienSx
Super User
Super User

Hello, @Janica123 

Table.TransformColumns(your_table, {"Column1", each Text.TrimStart(_, {"$", ":", "#", "d", "e"})})

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors