GrandTotal
The GrandTotal function returns the grand total for all records in a column based on a provided aggregate formula. GrandTotal is shorthand for Subtotal(aggregate, “grand_total”).
Usage notes
- The GrandTotal function can be used to return a summary aggregation for a column in each row of the column. For example, in a table with a column
[Number of Orders]containing the number of orders per customer, you can use the formulaGrandTotal(Sum([Number of Orders]))to repeat the total number of orders for all customers in each row. You can contrast this withSum([Number of Orders]), which returns the number of orders per customer. This can be used to make comparisons between each customer and the overall total.
Syntax
GrandTotal(aggregate)
Function arguments:
-
aggregate (required) - The aggregate formula to use in the function.
-
Examples:
Count(), Sum([Sales Amount])
Example
In a chart visualizing order counts per Product Type and Region, you can add a calculated column with the formula to the tooltip:
To see an overall total count of distinct orders across all categories.
-
The calculation is shown in the tooltip in this example, but can be used anywhere an aggregate formula is allowed.
![The function GrandTotal(CountDistinct([Order Number])) is used in a tooltip for a trellis bar chart. A user can now compare the total for each group to the grand total when hovering](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/a1dc7cf164a6a1f04fff03e63c5db37ec9f99332e76a7ab24df047112e598423/assets/docs-images/9ff429d-GrandTotal.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260824%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260824T173415Z&X-Amz-Expires=604800&X-Amz-Signature=d8fb7fda13214cc383ed35e2ad28aece3a6427c23ff537c28278b859f6208b69&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

