let
Source = Excel.CurrentWorkbook(), xx = Source{[Name="BDD"]}[Content],
#"Type modifié" = Table.TransformColumnTypes(D365Industriel_VDonneesProcess,{{"PRODUCTIONSITEID", Int64.Type}, {"FORMULE", type text}, {"PRD_FABRIQUE", Int64.Type}, {"LIBELLE_PRD_FAB", type text}, {"VERSION_FORMULE", type text}, {"TAILLE_BATCH", type number}, {"MULTIPLE", Int64.Type}, {"RENDEMENT", Int64.Type}, {"NOM_FORMULE", type text}, {"RENDEMENT_MIN", Int64.Type}, {"RENDEMENT_MAX", type number}, {"QUANTITY", type number}, {"QUANTITYDENOMINATOR", type number}, {"PRODUIT_CONSOMME", Int64.Type}, {"NOM_PRODUIT_CONSOMME", type text}, {"NUMERO_LIGNE_FORMULE", type number}, {"GAMME_LIEE_FORMULE", Int64.Type}, {"SEQUENCE_LIGNE_FORMULE", Int64.Type}, {"DESCRIPTION_LIGNE_FORMULE", type text}, {"TOLERENCE_CONSO_MAX", Int64.Type}, {"TOLERENCE_CONSO_MIN", type number}, {"GAMME", type text}, {"NOM_GAMME", type text}, {"OPERATION", type text}, {"NUM_OPEARTION", Int64.Type}, {"PRIORITE_OPERATION", Int64.Type}, {"ROUTEOPERATIONID", type text}, {"MACHINE", type text}, {"GROUPE_MACHINE", type text}, {"Groupe de coût", Int64.Type}}),
#"Autres colonnes supprimées" = Table.SelectColumns(#"Type modifié",{"PRD_FABRIQUE", "LIBELLE_PRD_FAB", "PRODUIT_CONSOMME", "NOM_PRODUIT_CONSOMME", "OPERATION", "MACHINE", "Groupe de coût"}),
#"Lignes filtrées" = Table.SelectRows(#"Autres colonnes supprimées", each ([OPERATION] = "8-CONDI") and ([Groupe de coût] = 2 or [Groupe de coût] = 10)),
#"Valeur remplacée" = Table.ReplaceValue(#"Lignes filtrées","800233","L100",Replacer.ReplaceText,{"MACHINE"}),
#"Valeur remplacée1" = Table.ReplaceValue(#"Valeur remplacée","886034","L200",Replacer.ReplaceText,{"MACHINE"}),
#"Lignes filtrées1" = Table.SelectRows(#"Valeur remplacée1", each ([MACHINE] <> "800192")),
#"Colonnes supprimées" = Table.RemoveColumns(#"Lignes filtrées1",{"OPERATION", "Groupe de coût"}),
B = ((x)=> {x{0}, x{1}, x{4}})(Table.ColumnNames(#"Colonnes supprimées")),
C = (x,y)=> List.Transform(x, each y{_}),
D = Table.Combine(Table.Group(#"Colonnes supprimées", B{0}, {"x", (x)=>
Table.FromRows({C({0,1,4}, Record.ToList(Table.First(x)))},B) & Table.FromColumns(C({2..4}, Table.ToColumns(x)),B)})[x])
in D