参考
let
源 = Excel.CurrentWorkbook(){[Name="demo"]}[Content],
类型 = Table.TransformColumnTypes(源,{{"销售经理", type text}, {"销售日期", type date}, {"销售金额", Int64.Type}}),
by = Table.AddColumn(类型, "by", each Number.From([销售日期]),Int64.Type),
解 = Table.Group(by
, {"销售经理"}
, {
"达标日期"
, (T)=>
let
R=Table.SelectRows(
Table.AddColumn(T
,"LJ"
,each List.Sum(List.FirstN(T[销售金额],[by]-List.Min(T[by])+1) ) )
,each [LJ]>=10)
in
Table.SelectRows(R,each [LJ]=List.Min(R[LJ]))[销售日期]{0}?
,type date
}
),
筛选 = Table.SelectRows(解, each ([达标日期] <> null))
in
筛选