Forum Discussion
Power Query Group By
- 5 years ago
It's not as efficient, but you can do it in a single filter step like this
= Table.SelectRows( #"Prev Step", (x) => x[LastTable] = List.Max( Table.SelectRows(#"Changed Type", each [Name] = x[Name])[LastTable] ) )It's doing essentially the same thing, i.e., checking if [LastTable] equals the maximal [LastTable] index over the sub-table that has a matching [Name].
Try a Group By on [Name] with max over [LastTable] as a separate query and then do a merge on the table in your screenshot using an inner join (and matching on both columns) to use the new separate query as a filter.
AlexisOlson Yes . I did that ( and it worked) . But the goal was to try just one query, once the whole project has many queries and functions.
Thank you anyway
- AlexisOlson5 years agoSuper User
It's not as efficient, but you can do it in a single filter step like this
= Table.SelectRows( #"Prev Step", (x) => x[LastTable] = List.Max( Table.SelectRows(#"Changed Type", each [Name] = x[Name])[LastTable] ) )It's doing essentially the same thing, i.e., checking if [LastTable] equals the maximal [LastTable] index over the sub-table that has a matching [Name].
- Fcoatis5 years agoPost Patron