SFDataEng
Contributor

Request: option for "Total (Sum)" row for Pivot Tables

Hi @OndrejHavlicek, your statement and implication appear correct, if I understand accurately.

Clarification

The "Grand Total" line added by the "Display total" checkbox uses the same aggregate function as used for the individual rows in that column, but across all underlying data for that column, to get the Total-aggregate-result, called total (in widget config pane) and Grand Total (in row label).

Source of confusion identified

I had been anticipating that the "Total" row added would always perform a "Sum" of the (potentially already aggregated) values above it.

  • For context, this anticipation that "Display Total" would result in a "Total (Sum)" row matches the Pivot Table's optional "Summary" row functionality in Apache Superset dashboards.
  • This "summing of aggregates to arrive at a total", in order to summarize aggregates of a type other than SUM(), needs to be used carefully, but is valid in some data shapes and use cases.

Conclusion

My comment was related to the OP's topic that


@Diegol1337 wrote:

...I want to be able to show a Total at the end of the table which sums the total ... of the column. Would also like for the Total to be flexible and always displayed....


Kind request

Given this clarity:

  • I am very grateful for the existing "Total / Grand Total" option that has been put in place, which appears to be a standard Pivot Table Total implementation.
  • I am very much hopeful and requesting for a second "Total (Sum) / Summary" option to be added to Pivot Tables, which would always Sum the values appearing immediately above it (even summing the aggregates arrived at by another function).

Image 

This is a contrived example, but we could get into what data shapes would make this valid, and why they are useful.  Hopefully, that is not needed.  In my current view, as a refinement from the image below, probably the "Display total" checkbox and optional "Grand Total" row can stay as they are as a feature; but "Total (Sum)" would be a good name for the distinct feature concept I was looking for (and, for a moment, thought I had found in this discussion!).

Databricks Pivot Table Total row, 2025-11-20_17.51UTC.png