Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
up
guess!!!
NewStep=Table.Combine(Table.Group(PreviousStepName,"Column1",{"n",each Table.RemoveLastN(_,each [Column1]<>"bbb")},0,(x,y)=>Byte.From(y="xxx"))[n])
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)")})
Hello Daniel,
I tested but only the first occurrence is removed, and in the next pattern it's the end delimiter that is removed.
rather, everything after the start delimiter is removed with the second occurence.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.