SYMPTOM
Custom subtotals that contain the First(x) Last(x) functions ignore the sort definition and instead sort by the metric value when sorted by hierarchy.
STEPS TO REPRODUCE:


CAUSE
This is a known issue in Strategy 10.x that has been logged with the internal reference ID DE29996.
WORKAROUND
Define the custom subtotal without the hierarchy and instead use the component attributes e.g. Last <SortBy=(Year, Quarter, Month)>(x){@, Year, Quarter, Month}
ACTION
This issue has been fixed in Strategy Secure Enterprise 10.4. Upgrade to this version to take advantage of the fix.