1 2 3 4 5 6 7 8 9 10 11 12
| let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Date ini", type date}, {"Date fin", type date}}),
#"Personnalisée ajoutée" = Table.AddColumn(#"Type modifié", "Date fin +1", each Date.AddDays([Date fin],1)),
#"Index ajouté" = Table.AddIndexColumn(#"Personnalisée ajoutée", "Index", 0, 1, Int64.Type),
#"Requêtes fusionnées" = Table.NestedJoin(#"Index ajouté", {"Condition", "Montant Condition", "Date fin +1"}, #"Index ajouté", {"Condition", "Montant Condition", "Date ini"}, "Personnalisée ajoutée", JoinKind.LeftOuter),
#"Personnalisée ajoutée développé" = Table.ExpandTableColumn(#"Requêtes fusionnées", "Personnalisée ajoutée", {"Date fin", "Index"}, {"Date fin.1", "Index.1"}),
#"Requêtes fusionnées1" = Table.NestedJoin(#"Personnalisée ajoutée développé", {"Index"}, #"Personnalisée ajoutée développé", {"Index.1"}, "Personnalisée ajoutée développé", JoinKind.LeftAnti),
#"Personnalisée ajoutée1" = Table.AddColumn(#"Requêtes fusionnées1", "Date fin retenue", each [Date fin.1] ?? [Date fin]),
#"Autres colonnes supprimées" = Table.SelectColumns(#"Personnalisée ajoutée1",{"Condition", "Montant Condition", "Date ini", "Date fin retenue"})
in
#"Autres colonnes supprimées" |
Partager