This won't really help you but this doesn't seem to be a Grouping nor a List.Sum issue
let
Source = {0.2,0.1,0.7 ,0.7,0.2,0.1},
FirstThree = List.FirstN(Source, 3),
LastThree = List.LastN(Source, 3),
ListSum_FirstThree = List.Sum(FirstThree), // 1
ListSum_LastThree = List.Sum(LastThree), // 0.99999999999999989
ListAccum_FirstThree = List.Accumulate(FirstThree, 0,
(state,current)=> state + current
), // 1
ListAccum_LastThree = List.Accumulate(LastThree, 0,
(state,current)=> state + current
), // 0.99999999999999989
ListGen_FirstThree = List.Last(
List.Generate(()=> [i=0, out=List.First(FirstThree)],
each [i] < List.Count(FirstThree),
each [i = [i]+1, out = [out]+FirstThree{i}],
each [out]
)
), // 1
ListGen_LastThree = List.Last(
List.Generate(()=> [i=0, out=List.First(LastThree)],
each [i] < List.Count(LastThree),
each [i = [i]+1, out = [out]+LastThree{i}],
each [out]
)
) // 0.99999999999999989
in
ListGen_LastThree
but
let
// Order of the last 3 items changed,
Source = {0.2,0.1,0.7 ,0.7,0.1,0.2},
LastThree = List.LastN(Source, 3),
ListSum_LastThree = List.Sum(LastThree), // 1
ListSum_EqualOne = ListSum_LastThree = 1, // TRUE
ListAccum_LastThree = List.Accumulate(LastThree, 0,
(state,current)=> state + current
), // 1
ListAccum_EqualOne = ListAccum_LastThree = 1, // TRUE
ListGen_LastThree = List.Last(
List.Generate(()=> [i=0, out=List.First(LastThree)],
each [i] < List.Count(LastThree),
each [i = [i]+1, out = [out]+LastThree{i}],
each [out]
)
), // 1
ListGen_EqualOne = ListGen_LastThree = 1 // TRUE
in
ListGen_EqualOne
With the previous observation I changed the order of the last 2 records in my SourceTable. Query code:
let
Source = Excel.CurrentWorkbook(){[Name="SourceTable"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,
{{"ID", Int64.Type}, {"mesic", Int64.Type}, {"rok", Int64.Type}, {"FTE", type number}}
),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID", "mesic", "rok"},
{{"FTE", each List.Sum([FTE]), type nullable number}}
),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "FTE equal 1", each
[FTE] = 1, type logical
)
in
#"Added Custom"