I have racked my brain with a solution for this problem and can never seem to crack it. I have to calculate Cost Per Head (CPH) for several different slices of a data set consisting of >500k rows. This is simplified, but suppose my data has a column for Month, Team, State, Account, Account Type...