This is Yuri (again), I've replied to your recent post here:
Same dataset, same problems -- mainly about using data blend and the consequences.
This one is as follows: one cannot use blended aggregate measures for dimension pill sorting.
This is because of data blending to occur after an internal representation of a view is built (from dimensions).
And the solution looks the same -- using a Table Calculation
to build a Measure to sort upon, and RANK() to assign numbers.
Since table calculations happen later in the Tableau operation pipeline,
they could reference blended aggregations to get the desired output.
As one could see, my solution uses the same table calculation
as in the above -- but this time it is for sorting Marks on a view.
And again, the Addressing is as important as the calc itself.
Please find the attached.
IR Sample_YF.twbx 1.1 MB