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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Alen1987
Frequent Visitor

Multiple column split in one step

Hi All
I am trying to split multiple columns in just one step. I did try several solutions but none did work for me.
I guess I need to use a list.
I have 3 columns, and all 3 should be splitting with different combinations of delimiters, but something like this
Left table is what I need to split to get the table on the right.

Alen1987_0-1720442183336.png

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this code

let

f= (z)=>[
    a = Record.ToList(z),
    b = List.Transform(a, (x)=>  Splitter.SplitTextByAnyDelimiter({"(",")"})(x)),
    c = List.Combine( List.Transform(b,(x)=> List.RemoveMatchingItems(x,{"",null}))),
    e = Table.FromRows({c})
][e],
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WStQw0lTSUUrSMAZRyRomJppKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    Custom1 = Table.Combine( Table.AddColumn(  #"Changed Type","Newtbl",f)[Newtbl])
in
    Custom1

View solution in original post

1 REPLY 1
Ahmedx
Super User
Super User

pls try this code

let

f= (z)=>[
    a = Record.ToList(z),
    b = List.Transform(a, (x)=>  Splitter.SplitTextByAnyDelimiter({"(",")"})(x)),
    c = List.Combine( List.Transform(b,(x)=> List.RemoveMatchingItems(x,{"",null}))),
    e = Table.FromRows({c})
][e],
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WStQw0lTSUUrSMAZRyRomJppKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
    Custom1 = Table.Combine( Table.AddColumn(  #"Changed Type","Newtbl",f)[Newtbl])
in
    Custom1

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.