- let
Source = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
Custom1 = Table.AddColumn(Source,"去年分数",each Table.SelectRows(Source,(x)=>x[年月]=[年月]-1 and x[姓名]=[姓名] and x[科目]=[科目])[分数]{0}?),
Custom2 = Table.AddColumn(Custom1,"本年总分",each List.Sum(Table.SelectRows(Source,(x)=>x[年月]=[年月] and x[姓名]=[姓名])[分数]))
in
Custom2
复制代码 |