我后面是想到了一个方法,但是如果只有一行的就不行。
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Branch Plant", type any}, {" Level", type number}, {" Item Number/Branch", type text}, {"Flash Message", type any}, {" Description", type any}, {"Column1", type any}, {"S/B", type text}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Top", each if [#" Level"] = 0 then [#" Item Number/Branch"] else null),
#"Added Conditional Column1" = Table.AddColumn(#"Added Conditional Column", "Top-Descriptions", each if [#" Level"] = 0 then [#" Description"] else null),
#"Added Conditional Column2" = Table.AddColumn(#"Added Conditional Column1", "Top-Level", each if [#" Level"] = 0 then [#"S/B"] else null),
#"Filled Down" = Table.FillDown(#"Added Conditional Column2",{"Top", "Top-Descriptions", "Top-Level"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Branch Plant] = null or [Branch Plant] = 380) and ([#" Level"] = 0.2 or [#" Level"] = 1)),
#"Reordered Columns" = Table.ReorderColumns(#"Filtered Rows",{"Branch Plant", "Top", "Top-Descriptions", "Top-Level", " Level", " Item Number/Branch", "Flash Message", " Description", "Column1", "S/B"}),
#"Removed Columns" = Table.RemoveColumns(#"Reordered Columns",{"Flash Message"})
in
#"Removed Columns" |