Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to concatenate Product Names with the same Product IDs.

Hi,   I can’t figure how to do this in Power Query. I have a table with two columns, Product_ID and Product_Name. It turns out that in some cases I have multiple Product_Name s for a given Product_...
  • Vijay_A_Verma's avatar
    4 years ago

    See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIsKMhJVYrVgfACUhOTM8A8IyDPOSO1qKgSLulflJiXDlQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product_ID = _t, Product_Name = _t]),
        #"Grouped Rows" = Table.Group(Source, {"Product_ID"}, {{"Count", each Text.Combine([Product_Name],"_"), type text}})
    in
        #"Grouped Rows"