Hi I'm have an issue with sorting in a pivot table. The table uses months for the columns and I would like the sort to be by the row values in the earliest month. The measures are all calculating correctly, it is just the sort that is an issue. In the example below, the two highlighted rows should be reversed. Below is the current sort expression, I understand what it is doing because it is calculating the count for the entire set of data, so when taking that into account, the order is correct.
Sort expression:
=Count(distinct {$<[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}>} [Order#])
I changed the sort expression to the one below adding to the set analysis to take the min value of the month (bold text)
=Count(distinct {$<[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}, [Month Starting]= {"$(=Min([Month Starting]))"}>} [Order#])
But this gives the following result:
I think this may be happening because it has a problem with the expression overall and is defaulting to something else.
Thanks in advance for any input / help.