抛砖引玉,自己只能做到这个程度
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
更改的类型 = Table.TransformColumnTypes(源,{{"学生姓名", type text}, {"所在班级", type text}}),
A = Table.Group(更改的类型, {"所在班级"}, {{"分组表", each _, type table [学生姓名=nullable text, 所在班级=nullable text]}}),
B = Table.ExpandListColumn(Table.TransformColumns(A,{"分组表",each Table.Split(_,10)} ),"分组表"),
C = Table.TransformColumns(B,{"分组表",each Table.Transpose(_)}),
#"展开的“分组表”" = Table.ExpandTableColumn(C, "分组表", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10"}),
筛选的行 = Table.SelectRows(#"展开的“分组表”", each ([Column1] <> "1年级1班" and [Column1] <> "1年级2班" and [Column1] <> "1年级3班"))
in
筛选的行 |