Hierarchy starting from project

Hi, Zane

Let me remind you the report I’m triying to create:
image

I was able to create a hierarchy completed with customfield as a measure that returns Epics contained in Change. It was created using Scriptrunner, calculated in Jira, called “cfield_contained_epics”
image

Second field “cfield_count_contained_epics” returns the size of array of contained epics to Change.
Now I wonder - how to get the sum of epics in the bottom of report?

I’ve tried to use Tuples, but didn’t successed. But I believe Robert Cacus’s idea is close to Solution