You can do it by grouping on product and adding an index column to the created table, then expand the table back out and pivot on the index. M code would be something like:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product Article ID", type text}, {"EAN", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Product Article ID"}, {{"AllData", each Table.AddIndexColumn(_,"Index",1,1), type table}}),
#"Expanded AllData" = Table.ExpandTableColumn(#"Grouped Rows", "AllData", {"EAN", "Index"}, {"EAN", "Index"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded AllData", {{"Index", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(#"Expanded AllData", {{"Index", type text}}, "en-GB")[Index]), "Index", "EAN")
in
#"Pivoted Column"
Sample attached.
Bookmarks