Creating excel-like table view by Tableau is not an ideal use case.
It's quite a bit troublesome..but "do-able"
You should not use standard G.total at all and need to add some workarounds to calculate G.total and show it appropriately.
Handling Measure value is not flexible, then need to assign dimension.
To assign dimensions, need to duplicate the data source.