Power Query
let
data = Excel.CurrentWorkbook(){[ Name = "Table2" ]}[Content],
group = Table.Group ( data, { "Product Article ID" }, { { "row", ( t ) => { t{0}[Product Article ID] } & t[EAN], type list } } ),
sortLst = List.Sort ( group[row], ( x ) => - List.Count ( x ) ),
toTbl = Table.FromList (
sortLst,
( x ) => x,
{ "Product Article ID" } & List.Transform ( { 1 .. List.Count ( sortLst{0} ) - 1 }, ( y ) => "EAN" & Text.From ( y ) )
),
sortTbl = Table.Sort ( toTbl, { { "Product Article ID", Order.Ascending } } )
in
sortTbl
Bookmarks