Hi Marja,
do you need to sort on multiple columns within the report or just one? If just one, then you could have two local members with the same calculation. One somewhere in the middle, one at the end which would be used for sorting and hidden.
If you need to sort on multiple local members in the same report I don't have a solution.
BR,
Arnold