Forum Discussion
Anonymous
1 year agoNot applicable
Eliminating duplicates rows in table
My table has the folowwing data. I only want the row where Col2 has the max value. Is there a method to do this at the Table view level? If not what would be an alternative mehtod? Col1 Col2 ...
- Anonymous1 year ago
Hi Anonymous ,
Please try this code in power query advanced editor,
let Source = #table( {"Col1", "Col2"}, { {1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {2, 4}, {3, 5}, {3, 4}, {3, 3} } ), NewTable = Table.Group( Source, {"Col1"}, {{"Col2", each List.Max([Col2])}} ) in NewTableBest Regards,
Bof
Anonymous
1 year agoNot applicable
Bof, This seems to work. However my existing table is very large so I don't want to duplicate it. Is there a way I can use this summarize function in conjuction with my existing table?
Anonymous
1 year agoNot applicable
Hi Anonymous ,
Please try this code in power query advanced editor,
let
Source = #table(
{"Col1", "Col2"},
{
{1, 1},
{1, 2},
{1, 3},
{2, 2},
{2, 3},
{2, 4},
{3, 5},
{3, 4},
{3, 3}
}
),
NewTable = Table.Group(
Source,
{"Col1"},
{{"Col2", each List.Max([Col2])}}
)
in
NewTable
Best Regards,
Bof