What are you trying to sort? the average for a particular year? Or the sum of each category's averages across all years?
You can use an aggregate calc as a sort by making it a discrete pill and shoving it at the front of the ROWS list. (Or COLUMNS list, if that's what you want to sort.)
Thanks Shivaram. the issue is that sometimes i don't have a category in a specific year so your fucntion created a Null ranking and was grouping multiple categories into same rank or sort. see below:
i have million of rows and I like to be able to sort by the average amount which uses an IF function that has Attr in it. I like to sort by category descending order based on average amount aggregate by all years.
Thanks for the help