问题:为数据添加按类别小计的计数和求和列
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
添加分类计数列 = Table.AddColumn(源, "分类计数", each Table.RowCount(Table.SelectRows(源, (x) => x [类别] = [类别]))),
添加分类求和列 = Table.AddColumn(添加分类计数列, "分类求和", each List.Sum(Table.SelectRows(源, (x) => x [类别] = [类别])[数量])),
更改的类型 = Table.TransformColumnTypes(添加分类求和列,{{"类别", type text}, {"数量", Int64.Type}, {"分类计数", Int64.Type}, {"分类求和", Int64.Type}})
in
更改的类型
标签:Power,求和,分类,计数,添加,Table,类别,Query From: https://www.cnblogs.com/officeplayer/p/16906677.html