How I can apply sorting on a measure
To apply sorting on the measure, just duplicate that measure and place it in the first place in the row shelf. For example, if we want to sort on sales then simply create a report for category vs sales. And then drag sales again in row shelf by pressing ctrl button.
Make sure to keep the duplicate sales measure in discrete form. As you can see below, we have the report in ascending order-