You need to enable partial sums of the dimension in a pivot table to show the totals. You can do this on the Presentation tab of the properties screen. In a straight table your expression must be such that it can be aggregated. It may be necessary to use the aggr function to achieve this. And of course the Total Mode needs to be set to something other than No Totals.