Set Analysis is a great way to aggregate data based off of conditions that you define within a set of data. It calculates measures over other data sets than what is in the current selection.
Watch the video to learn more.
And read HIC's blog post as well for a great primer on this very topic.