Forum Discussion

RNightscape's avatar
RNightscape
Frequent Visitor
7 years ago
Solved

Group and concatenate

Hi all ,

On my table I would like to use 2 columns to group and concatenate the others to create a unique value about the purchase.

Is it possible?

 

This is the data

 

 

 

 

 

 

And This is the result I need.

 

 

 

 

Thanks in advance

2 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    RNightscape

     

    You can use this

     

    Go to the advanced query editor and copy paste this

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckrMyVHSUQoOABJOOaWpQCooP6UoMz1fKVYHLh3kBSJSU9BkgwtLE4tS0bT7JhYl5xejyiPpR5IOKcpMzEvPASnwSyxJBFkUmZqTk1+ObE0sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Product = _t, Store = _t, Color = _t, Seller = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Store", type text}, {"Color", type text}, {"Seller", type text}}),
        #"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"Product", "Seller", "Store", "Color"}),
        #"Grouped Rows" = Table.Group(#"Reordered Columns", {"Product", "Seller"}, {{"Stores", each Text.Combine(Table.Column(_,"Store"),"-"), type table},{"Color", each Text.Combine(Table.Column(_,"Color"),"-"), type table}})
    in
        #"Grouped Rows"