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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
MattAtBP
Frequent Visitor

Split multiple columns and 'join/assign'

Hi,

Recently got a data set that has multiple columns, each contain mulitiple values separated by pipe. I'm trying to separate them out, but then assign as shown below. The first instance / value of column one, matches to the first instance / value in second column, 2nd matches to second etc etc. Apologies if I'm not explaining it very well - i'm hoping the picture below does a better job.

 

split and assign.png

1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi,  @MattAtBP 

 

= Table.FromColumns(
{
List.Combine(List.Transform(YourSource[Risk ID], each Text.Split(_, " | "))),
List.Combine(List.Transform(YourSource[Risk Title], each Text.Split(_, " | ")))
},
{"Risk ID", "Risk Title"}
)

then sort by ID

 

Stéphane

 

View solution in original post

6 REPLIES 6
MattAtBP
Frequent Visitor

Thank you all @slorin @Omid_Motamedise @ThxAlot  for your responses - all three appoaches worked well.

Omid_Motamedise
Super User
Super User

Hi @MattAtBP  

This is solution for your question, just copy it and past it into the advance editor

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMq4xrbFU0lFyrHGqcVaK1YlWMqoxAfJdalzBPMMasxrzGgugiFuNe41HjadSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Risk ID" = _t, #"Risk Title" = _t]),
    split = Table.TransformColumns(Source,{{"Risk ID", each Text.Split(_,"|")}, {"Risk Title",each Text.Split(_,"|")}}),
    merged = Table.CombineColumns(split,{"Risk ID", "Risk Title"},List.Zip,"Merged"),
    #"Expanded Merged" = Table.ExpandListColumn(merged, "Merged"),
    Custom1 = Table.SplitColumn(#"Expanded Merged","Merged", each _,{"ID","Title"}),
    #"Sorted Rows" = Table.Sort(Custom1,{{"ID", Order.Ascending}})
in
    #"Sorted Rows"

 

 

If this answer helped resolve your issue, please consider marking it as the accepted answer. And if you found my response helpful, I'd appreciate it if you could give me kudos. 

Thank you!


If my answer helped solve your issue, please consider marking it as the accepted solution.

it will result in 

Omid_Motamedise_0-1731967652989.png

 


If my answer helped solve your issue, please consider marking it as the accepted solution.

Its going to convert 

Omid_Motamedise_0-1731967605453.png

 

to this one

 

Omid_Motamedise_1-1731967618704.png

 

 


If my answer helped solve your issue, please consider marking it as the accepted solution.
ThxAlot
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RYy7DsIwDEV/xcrMwhvmIjGBQOpWdTCpC1bTGCUOCCkfT4CB8R6dc5vGzPMyb83EnEQC7FARzgkd6wsy7EmV/RVUBMR1hRxFgb1SoKjUmXbSmFlelLyS8Z4Kh0sgHOJHJX1KGEAeFJzgT57mVV7nTQlqsjfPFl3Hfc82OWUqWSVRv0ny5aPmkf7rgDYI9MgumrZ9Aw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Risk ID" = _t, #"Risk Title" = _t]),
    #"Transformed rows" = List.Transform(Table.ToRows(Source), (row) => Table.FromColumns(List.Transform(row, each List.Transform(Text.Split(_, "|"), Text.Trim)), {"Risk ID","Risk Title"})),
    Combined = Table.Combine(#"Transformed rows")
in
    Combined

ThxAlot_0-1731964574366.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



slorin
Super User
Super User

Hi,  @MattAtBP 

 

= Table.FromColumns(
{
List.Combine(List.Transform(YourSource[Risk ID], each Text.Split(_, " | "))),
List.Combine(List.Transform(YourSource[Risk Title], each Text.Split(_, " | ")))
},
{"Risk ID", "Risk Title"}
)

then sort by ID

 

Stéphane

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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