Forum Discussion
Fcoatis
5 years agoPost Patron
Power Query Group By
Hello, I am transforming a bunch of PDF files and I get to the point where I need to extract the last table of each file. I tried to use Group By by the max of column "LastTable" But its n...
- 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].
AlexisOlson
5 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].
Fcoatis
5 years agoPost Patron