You could create a custom grand total calculation to control the output of each grand total field (not in this view) and it can be defined as desired. Every measure would need to be setup to have a if then end statement that identifies the total column from the other columns. Jonathan Drummey has a great post about this sort of thing here - Customizing Grand Totals – Part 2 | Drawing with Numbers
You could control which columns will be used across all your calculations with a parameter if you needed to change the 5 and the 3 in the example above.
It's going to depend if this is a one off report or an ongoing report that changes to determine how much effort goes into building a view. The easier solution is just to create another view with the exact calculation desired and then put this into a dashboard next to measures in this view. That view would not include any dimension desired in a total.
I hope that helps and best of luck