Forum Discussion
How to link related items?
- Anonymous3 years ago
Hi mraka9
You can put the following code in Advanced Editor in power query:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8s1PysxJ1TUyUdKBsQ2NlGJ1opWcE4t0DY2BwiCGOVgIoUAHSSNMsTlUraEBWMgjv7Q4VdfYACgKYRoZYSo1RlJqZARXamyAyz5ToEwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Product A" = _t, #"Product B" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product A", type text}, {"Product B", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", (x)=>Text.Combine(Table.SelectRows(#"Changed Type",(y)=>y[Product A]=x[Product B] )[Product B] ,",") ) in #"Added Custom"Output:
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mraka9
You can try the following ways:
1.Delete "each" from your code.
2.Add a blank step:
then copy the sample code to the step
= Table.AddColumn(#"Changed Type", "Custom", (x)=>Text.Combine(Table.SelectRows(#"Changed Type",(y)=>y[Product A]=x[Product B] )[Product B] ,","))
if the table name or column name is different from yours, you need to change it.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Unfortunately, the data is being processed for a long time, but there are no results. Anyway, I'll accept your solution as it's great, although I can't get it to work on my base. Thanks again