To position the totals of a hierarchy to appear before or after their children, click on the hierarchical grouping icon. The options are totals at start, totals before, totals after and totals at end. This setting can be saved with the view and is independent of any sorts that are based on data.
It can be overridden by the options chosen in a data sort.