let
Dossier = "C:\PQ\excel2\Magasins",
fx = (x)=>
[
a = List.Buffer(List.Combine(List.Distinct(List.Split(List.Combine (List.Select(List.Transform(Table.ToRows(x),
(x)=> List.RemoveNulls(x)), each List.Count(_) <> 0)),2)))),
b = List.PositionOf(a, "GPS") + 2,
c = List.RemoveItems(List.Range(a, b, List.Count(a) - b), {"Catégorie", "CA", "Bénéfice"}),
d = List.Zip({List.TransformMany(List.Select(c, each not Value.Is(_, type number)), (y)=> {" - CA", " - Bénéf"},
(x,y)=> x & y)} & {List.Select(c, each Value.Is(_, type number))}),
e = Table.PromoteHeaders(Table.FromColumns(List.Split(List.Range(a, 0, b),2) & d))
] [e] ,
Source = List.Transform(Table.SelectRows(Folder.Files(Dossier), each [Attributes]?[Hidden]? <> true)[Content], (x)=> Excel.Workbook(x)[Data]{0}),
Result = Table.Combine(List.Transform(Source, each fx(_)))
in
Result