1 2 3 4 5 6 7 8 9 10 11
| let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
ModifierTypes = Table.TransformColumnTypes(Source,{{"Colonne1", type text}, {"Colonne2", type text}, {"Colonne3", type any}, {"Colonne4", type any}, {"Colonne5", type any}, {"Colonne6", type any}, {"Colonne7", type any}, {"Colonne8", type any}, {"Colonne9", type any}, {"Colonne10", type any}, {"Colonne11", type any}, {"Colonne12", type any}, {"Colonne13", type any}, {"Colonne14", type any}, {"Colonne15", Int64.Type}}),
SupprimerPremièreLigne = Table.Skip(ModifierTypes,1),
PromouvoirPremièreLigne = Table.PromoteHeaders(SupprimerPremièreLigne, [PromoteAllScalars=true]),
AdapterTypes = Table.TransformColumnTypes(PromouvoirPremièreLigne,{{"Column1", type text}, {"Column2", type text}, {"Lundi", Int64.Type}, {"Mardi", Int64.Type}, {"Mercredi", Int64.Type}, {"Jeudi", Int64.Type}, {"Vendredi", Int64.Type}, {"Samedi", Int64.Type}, {"Lundi_1", Int64.Type}, {"Mardi_2", Int64.Type}, {"Mercredi_3", Int64.Type}, {"Jeudi_4", Int64.Type}, {"Vendredi_5", Int64.Type}, {"Samedi_6", Int64.Type}, {"Column15", Int64.Type}}),
RegrouperSurPersonneEtType = Table.Group(AdapterTypes, {"Column1", "Column2"}, {{"Lundi contrat", each List.Sum([Lundi]), type nullable number}, {"Mardi contrat", each List.Sum([Mardi]), type nullable number}, {"Mercredi contrat", each List.Sum([Mercredi]), type nullable number}, {"Jeudi contrat", each List.Sum([Jeudi]), type nullable number}, {"Vendredi contrat", each List.Sum([Vendredi]), type nullable number}, {"Samedi contrat", each List.Sum([Samedi]), type nullable number}, {"Lundi planning", each List.Sum([Lundi_1]), type nullable number}, {"Mardi planning", each List.Sum([Mardi_2]), type nullable number}, {"Mercredi planning", each List.Sum([Mercredi_3]), type nullable number}, {"Jeudi planning", each List.Sum([Jeudi_4]), type nullable number}, {"Vendredi planning", each List.Sum([Vendredi_5]), type nullable number}, {"Samedi_Planning", each List.Sum([Samedi_6]), type nullable number}}),
RemplacerNull = Table.ReplaceValue(RegrouperSurPersonneEtType,null,0,Replacer.ReplaceValue,{"Lundi contrat", "Mardi contrat", "Mercredi contrat", "Jeudi contrat", "Vendredi contrat", "Samedi contrat", "Lundi planning", "Mardi planning", "Mercredi planning", "Jeudi planning", "Vendredi planning", "Samedi_Planning"}),
AjouterTotal = Table.AddColumn(RemplacerNull, "Total", each [Lundi contrat]+[Mardi contrat]+[Mercredi contrat]+[Jeudi contrat]+[Vendredi contrat]+[Samedi contrat]+[Lundi planning]+[Mercredi planning]+[Jeudi planning]+[Vendredi planning]+[Samedi_Planning])
in
AjouterTotal |
Partager