you can sort groups on anything that can be derived via a summary function. Sometimes being creative in that process can give you a sorting result even if it is not the final dsiplay value.
Of course doing calcs in a stored proc give you values to sort on straight in your dataset
what is your data and how do you want it sorted?