|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
分组依据,添加索引列,删除多于列后展开
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
更改的类型 = Table.TransformColumnTypes(源,{{"系列", type text}, {"因素", type text}}),
分组的行 = Table.Group(更改的类型, {"系列", "因素"}, {{"计数", each _, type table [系列=nullable text, 因素=nullable text]}}),
已添加索引 = Table.AddIndexColumn(分组的行, "索引", 1, 1, Int64.Type),
重排序的列 = Table.ReorderColumns(已添加索引,{"系列", "因素", "索引", "计数"}),
删除的列 = Table.RemoveColumns(重排序的列,{"系列", "因素"}),
#"展开的“计数”" = Table.ExpandTableColumn(删除的列, "计数", {"系列", "因素"}, {"系列", "因素"})
in
#"展开的“计数”"
|
|