I don't think that this is possible within the same proc report. Because proc report works from top the bottom and within that from left to right. You would need a step after that to sort the data.
I suggest you do the sum for "total" in a data step before the proc report and then do the proc report and define the new variable as order / group.
Best wishes,
Eva
SAS Innovate 2025: Save the Date
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!