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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to replace/remove text between delimiters when there are multiple delimiters ?

Hello, 

 

How to replace/remove text between delimiters when there are multiple delimiters ?

 

Case : 

 

value on the cell : 

 

aaa

bbb

ccc

eee

aaa

bbb

ccc

eee

aaa

bbb

ccc

xxx

eee

aaa

bbb

ccc

eee

aaa

bbb

ccc

xxx

eee

....

 

I am looking to remove only the values in red.

 

Thanks!

 

 

6 REPLIES 6
Anonymous
Not applicable

up

guess!!!

NewStep=Table.Combine(Table.Group(PreviousStepName,"Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])

Anonymous
Not applicable

Hello Daniel,

 

Thanks for your try.

 

This doesn't seem to work it erases all the value 😞

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSkxMjMmLyUtKSgJRycnJICo1NRVEkSxXUVFBHe1KsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Colonne 1" = _t]),
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Colonne 1", type text}}),
#"Colonnes renommées" = Table.RenameColumns(#"Type modifié",{{"Colonne 1", "Column1"}}),

NewStep=Table.Combine(Table.Group(#"Colonnes renommées","Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])
in
NewStep

 

 

NewStep= Table.TransformColumns(Source,{"Colonne 1",each let a=Table.FromList(Splitter.SplitTextByWhitespace()(_),each {_}) in Text.Combine(Table.Combine(Table.Group(a,"Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])[Column1],"#(lf)")})

Anonymous
Not applicable

Hello Daniel,

 

I tested but only the first occurrence is removed, and in the next pattern it's the end delimiter that is removed.

 

cher90_0-1666683785831.png

 

Anonymous
Not applicable

rather, everything after the start delimiter is removed with the second occurence.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.