GroupHeader-/GroupFootertemplate - One group belonging to another group

I have the same requirement, to display group and subgroup totals. Looked like this post had a solution, or something similar:

Not sure if I interpreted it well, but looks like the suggestion was to include multiple lines in the group footer template.

It didn't work for me, just got the same value twice on the subgroup, instead of another line at the end with the group totals.

Is it possible to achieve this ?