How do I add a row with column totals to my query?

Row totals and column totals are available in the options menu in the Results tab (rather than the Chart tab).

If your row/column totals don’t match the values you were expecting, check out this article to troubleshoot.

If you need to do a row total in the calculation (eg. to reference it in another calculation), then you can use the forumla =SUM(PIVOTOFFSET(B1, 0, 0, 1, 5000)), which will sum all of the values in B1, from column 1 to column 5000.