Hi Jacob,
Its simple, you need to do this in the Universe if you don't want that Overflow error when you've lot of data in the report, try this blog:
The formula for the Final objects will be a little bit different depending on the type of database you have. I've used this logic 3 times and it works perfect.
Hope that helps.
Thanks,
Mahboob Mohammed