let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
ModType = Table.TransformColumnTypes(Source,{{"CONTRATS", type text}}),
Fract = Table.ExpandListColumn(Table.TransformColumns(ModType, {{"VILLE", Splitter.SplitTextByDelimiter(", ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "VILLE"),
GroupBy = Table.Group(Fract, {"VILLE"}, {{"RESP.", each Text.Combine([#"RESP."],",")}, {"Tbl", each _, type table [#"RESP."=text, CATÉGORIE=text, CONTRATS=nullable text, VILLE=nullable text]}}),
Expand = Table.ExpandTableColumn(GroupBy, "Tbl", {"CATÉGORIE", "CONTRATS"}, {"CATÉGORIE", "CONTRATS"}),
Pivot = Table.Pivot(Expand, List.Distinct(Expand[CATÉGORIE]), "CATÉGORIE", "CONTRATS")
in
Pivot