I think you're looking for something like this
My lookup function gives what you're asking to be grand total. You can named that field to grand total. In your case each row is category and each column is month/year. So it is the same setup with different fields so you should be able to easily replicate with your data.