Note: cannot post data because it exceeds 15000 charactersCode:let From = Excel.CurrentWorkbook(){[Name="From"]}[Content][From]{0}, To = Excel.CurrentWorkbook(){[Name="To"]}[Content][To]{0}, Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], UOC = Table.UnpivotOtherColumns(Source, {"Labels"}, "Attribute", "Value"), Type = Table.TransformColumnTypes(UOC,{{"Attribute", Int64.Type}}), Select = Table.AddColumn(Type, "Select", each List.Select({[Attribute]}, each (_ >= From and _ <= To))), Expand = Table.ExpandListColumn(Select, "Select"), FilterNull = Table.SelectRows(Expand, each ([Select] <> null)) in Table.Group(FilterNull, {"Labels"}, {{"Sum", each List.Sum([Value]), type number}})
Bookmarks