How do Summary Formulas compute aggregate percentages and ratios across grouped report data?
Answer
Basics: A row-level calculation works per record; a summary formula works on totals. For example, "Won amount divided by total amount per owner" needs both aggregates, so it must be computed after grouping. You add them in Summary, Matrix and Joined reports (Joined via cross-block formulas); tabular reports do not support them.
How it works:
- In the report builder, Add Summary Formula in the Columns/Outline.
- Name it, choose the format (Number, Currency or Percent) and decimal places.
- Choose where it displays: all summary levels, or specific groupings and Grand Total.
- Write the formula using aggregate fields, for example
AMOUNT:SUM / RowCount. - Apply and optionally add it to charts or conditional highlighting.
Advanced / deep dive: Special functions: PARENTGROUPVAL(summary_field, parent_level) returns the parent group's value (to compute share of parent or total), and PREVGROUPVAL(summary_field, group_level) returns the previous group's value (for period-over-period change). Percent of total: RowCount / PARENTGROUPVAL(RowCount, GRAND_SUMMARY). Because formulas run at each level, an average of averages problem can mislead: dividing sums and counts yourself is safer than relying on summarized averages. Summary formulas cannot be used as report filters and have complexity limits; there is a cap on formulas per report (about 10; verify). They can appear in dashboards and conditional highlighting. Use a divide-by-zero guard such as IF(RowCount = 0, 0, ...). For heavy analytics beyond group-level calculation, consider CRM Analytics (formerly Tableau CRM).
Code / config example:
// Win rate per owner (Percent format, display at Opportunity Owner level)
IF(RowCount = 0, 0, Opportunity.Won_Count__c:SUM / RowCount)
// Share of grand total amount per group
AMOUNT:SUM / PARENTGROUPVAL(AMOUNT:SUM, GRAND_SUMMARY)
// Change vs previous month (group by Close Date month)
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)