1 2 3 4 5 6 7 8 9
| let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Facturation", type text}, {"Filiale", type text}, {"Adr", type text}, {"Dispatch", type text}, {"Nbre", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Facturation"}, {{"Lignes", each _, type table}, {"Dispatch O?", each List.Max([Dispatch]), type text}, {"Adr X?", each List.Max([Adr]), type text}}),
#"Filtered subrows" = Table.AddColumn(#"Grouped Rows", "Lignes filtrées", each if [#"Dispatch O?"] = "O" or [#"Adr X?"] = null then [Lignes] else Table.SelectRows([Lignes], each _[Adr] = "X"), Value.Type(#"Grouped Rows"[Lignes]{0})),
#"Removed Columns" = Table.RemoveColumns(#"Filtered subrows",{"Lignes", "Dispatch O?", "Adr X?"}),
#"Expanded {0}" = Table.ExpandTableColumn(#"Removed Columns", "Lignes filtrées", {"Filiale"}, {"Filiale"})
in
#"Expanded {0}" |
Partager