Group by solution

Paul_Christie

New member
Joined
Mar 23, 2016
Messages
153
Reaction score
0
Points
0
Location
Nottingham, UK
Website
www.instantpages.ltd.uk
Excel Version(s)
Office 365 Monthly update
About this time last year I posted a question about using Group By in Power Query. I was about to post a supplementary to that post but I've found the answer myself so I thought I'd post the solution for the benefit of anyone else who might need it.

The situation this time is that I have fields F1, F2 through to F8. I want to Group By fields F1 & F2 do an Average on F3, F4, F5 and F6 and then do a last on F7 and F8. The Group by user interface doesn't give you Last as an option but it does give you Max and Min. If you select Max it will create the following

{"MaxF7", each List.Max([F7]), type text}

If you edit this you can use Last instead of Max

{"LastF7", each List.Last([F7]), type text}

I assume that there are other functions that will work in the same way but this was the one I needed on this occasion.
 
Back
Top