|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
添加分组列 = Table.AddColumn(源, "year", each Text.From(Date.Year([date]))&Text.From(Date.Month([date]))),
分组的行 = Table.Group(添加分组列, {"year"}, {"data1", each List.Last(Table.ToRecords(_))}),
展开并删除 = Table.RemoveColumns(Table.ExpandRecordColumn(分组的行, "data1", {"date", "goumai", "gongchang", "sum", "year"}, {"date", "goumai", "gongchang", "sum", "year1"}),{"year", "year1"}),
更改的类型 = Table.TransformColumnTypes(展开并删除,{{"date", type date}})
in
更改的类型 |
|