I don't see Gross Margin having anything to do with the hierarchy itself. It's just a calculated field that is summing (or subtracting) totals of various account group totals.
And yes, that's basic stuff for Tableau to do.
I believe Paul wants 'Gross Margin' to be added as an element in Account Group dimension. Pardon me if I'm missing something but using calculated field we can calculate the what OP is looking for but we can't assign it to 'Gross Margin' element in Account Group as Gross margin doesn't exist, right?
Maneesh -- I hadn't considered that Paul might be asking that.
You're right. We can't add dimension values.
If the goal is to create that extra line on the viz, I would create the calc to derive the number, and create a second sheet with the proper formatting to display it below the data sheet on a dashboard. Formatting can make it look like a single sheet to the user.