Custom Summary Formulas and Row-Level Formulas

5 minutes 5 Questions

In Salesforce reporting, Custom Summary Formulas and Row-Level Formulas are two powerful tools for extending report calculations without changing the underlying data model, and both are key topics for the Platform Administrator II exam under Data and Analytics Management. Custom Summary Formulas (CSFs) operate on summarized or grouped data. They are available in Summary, Matrix, and Joined reports (not Tabular) and calculate values based on aggregate functions such as SUM, AVG, MAX, MIN, and RowCount. For example, you could create a formula like SUM(Amount) / RowCount to show average deal size per grouping, or use PARENTGROUPVAL and PREVGROUPVAL to compare a group's total against its parent or the preceding group (useful for percent-of-total or month-over-month growth). You can control where the formula displays: at grand total only, at all summary levels, or at specific grouping levels. A report may contain up to five custom summary formulas, and in Joined reports, cross-block formulas can reference fields across multiple blocks. Row-Level Formulas, by contrast, evaluate each individual record in the report and display results as a new column alongside the existing fields. They are ideal for ad hoc calculations such as days between two dates (CloseDate - CreatedDate), concatenating text, or applying IF logic to categorize records—all without requiring an administrator to create a custom formula field on the object. Row-level formulas can return Number, Text, or Date types, reference up to five fields, and only one row-level formula is allowed per report. They are available in Lightning Report Builder for all report formats except Joined reports. In summary: use Custom Summary Formulas when you need calculations across aggregated groups or totals, and use Row-Level Formulas when you need per-record calculations displayed as a column. Understanding this distinction, along with their limits and supported report formats, is essential for the certification.

Custom Summary Formulas and Row-Level Formulas in Salesforce Reports: A Complete Guide for the Advanced Administrator Exam

Why This Topic Matters

Salesforce reports are the primary way business users turn raw records into insight. Standard summaries (Sum, Average, Min, Max) and standard fields cover many needs, but real business questions often require calculations that do not exist as fields on the object. Custom Summary Formulas and Row-Level Formulas let administrators perform these calculations directly inside a report, without creating new custom fields, without consuming field limits, and without changing the data model. The Salesforce Advanced Administrator exam tests this under the Advanced Data and Analytics Management domain, and questions frequently ask you to choose the right tool for a calculation scenario. Knowing the difference between a row-level formula, a summary formula, a custom formula field, and a bucket field is essential to scoring well.

What Are They? Definitions

Row-Level Formula
A row-level formula is a calculation performed on each individual record (row) in a report. It appears as a new column in the report. It is used when you need a value calculated per record, such as the number of days between two dates, a concatenation of two text fields, or a percentage derived from two numeric fields on the same record.

Key characteristics of row-level formulas:
- Evaluated once per record in the report.
- You can add only one row-level formula per report.
- Can reference up to 5 fields (originally 3 in early releases, expanded later; the exam generally expects you to know there is a small limit, and 5 fields is the current figure).
- Return type can be Number, Text, or Date.
- Available in the Lightning Report Builder only, not in Classic.
- Cannot be used to summarize, group, filter (in most cases), or be referenced in cross filters or summary formulas... with one exception: you cannot group by a row-level formula column.
- Is not saved to the database; it exists only inside the report.
- Available on tabular, summary, and matrix reports (not joined reports).

Custom Summary Formula
A custom summary formula is a calculation performed on summarized (aggregated) data at grouping levels in a report. It does not appear on individual rows; instead it appears next to subtotals and grand totals. Use it when the question is about totals, averages, ratios of aggregates, or percentages of a total, for example: Win Rate = Closed Won Amount / Total Amount, or Average Deal Size per Rep.

Key characteristics of custom summary formulas:
- Require a Summary, Matrix, or Joined report (not tabular) because they need grouping.
- Up to 5 custom summary formulas per report (in joined reports, up to 5 per block, and up to 10 cross-block formulas).
- Reference summary fields using functions such as SUM, AVG, MIN, MAX (e.g., AMOUNT:SUM, RowCount).
- Return type can be Number, Currency, or Percent.
- Can be displayed at All summary levels, Grand total only, or a specific grouping level.
- Support the PREVGROUPVAL and PARENTGROUPVAL functions for comparing across groupings.
- Available in both Classic and Lightning report builders.
- Cannot be used in report filters or as a grouping.

How They Work: The Mechanics

Building a Row-Level Formula (Lightning)
1. Open the report in Lightning Report Builder.
2. In the Outline pane under Columns, click the dropdown arrow and select Add Row-Level Formula.
3. Give it a name, choose the output type (Number, Text, Date), and set decimal places if numeric.
4. Insert fields and functions. Example: CloseDate - CreatedDate (as DATEVALUE if needed) to calculate Days to Close.
5. Validate and apply. The new column shows the result for every row.

Example row-level formula: Amount * 0.1 to display a 10% commission per opportunity. Another: IF(ISBLANK(Email), "Missing", "Present") returning Text.

Building a Custom Summary Formula
1. Group the report by at least one field (e.g., Owner, Stage, or Close Month).
2. In the Outline pane under Columns, select Add Summary Formula.
3. Choose a name, format (Number, Currency, Percent), decimal places.
4. Choose where to display: All Summary Levels, Grand Total Only, or a specific group.
5. Build the formula referencing summarized fields, e.g., AMOUNT:SUM / RowCount for average deal size, or WON:SUM / CLOSED:SUM for win rate.
6. Validate and apply.

PREVGROUPVAL and PARENTGROUPVAL
These are heavily tested because they are unique to summary formulas.
- PREVGROUPVAL(summary_field, grouping_level [, increment]): returns the value of the summary field from the previous group at the same level. Use it for month-over-month growth: AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE). The optional increment (1 to 12) lets you compare to a group several positions back (e.g., same month last year with increment 12).
- PARENTGROUPVAL(summary_field, grouping_level): returns the value from the parent grouping level. Use it for percent of total: AMOUNT:SUM / PARENTGROUPVAL(AMOUNT:SUM, GRAND_SUMMARY). In matrix reports, you specify both row and column grouping: PARENTGROUPVAL(AMOUNT:SUM, ROW_GRAND_SUMMARY, COLUMN_GRAND_SUMMARY).

Cross-Block Custom Summary Formulas (Joined Reports)
In joined reports, a cross-block formula calculates across multiple blocks. For example, dividing Cases:RowCount from Block 2 by Accounts:RowCount from Block 1 to get Cases per Account. Fields are referenced with a block prefix like B1#AMOUNT:SUM. Up to 10 cross-block formulas per joined report. The blocks must share a common grouping for the formula to compute correctly at that level.

Choosing the Right Tool: Comparison Table

- Need a per-record calculation shown on each row in one report? Row-Level Formula.
- Need a calculation on totals, subtotals, ratios of sums, or percent of total? Custom Summary Formula.
- Need the calculated value available in many reports, on page layouts, in list views, or in filters/groupings? Custom Formula Field on the object.
- Need to categorize values into ranges or labels (e.g., Small/Medium/Large) and group by them? Bucket Field.
- Need to compare current group to the previous group (trend)? PREVGROUPVAL in a summary formula.
- Need percent of grand total or percent of parent group? PARENTGROUPVAL in a summary formula.
- Need a calculation spanning two report types in a joined report? Cross-Block Custom Summary Formula.

Limits and Restrictions to Memorize

- Row-level formulas: 1 per report, up to 5 field references, Lightning only, output Number/Text/Date, not available in joined reports, cannot group or summarize by it (though numeric row-level formulas can be summarized in some cases, the safe exam answer is that they are limited).
- Custom summary formulas: 5 per report (5 per block in joined reports, plus 10 cross-block), Number/Currency/Percent, requires grouping (Summary, Matrix, Joined), cannot be used as filters or groupings.
- Formula length: 3,900 characters for summary formulas.
- Summary formulas cannot reference other summary formulas, and row-level formulas cannot reference summary values.
- Neither formula type is stored in the database; they exist only within the report definition. Changing a field's API name may break them.
- Custom summary formulas can be used on report charts and dashboards as metrics.
- You cannot use a row-level formula in a cross filter or as a dashboard filter.

Common Real-World Scenarios

1. Sales wants to see each opportunity's age in days on a report. Row-level formula: TODAY() - DATEVALUE(CreatedDate).
2. Management wants win rate by sales rep. Summary report grouped by Owner, custom summary formula: closed-won count divided by total closed count, displayed at the Owner grouping.
3. Finance wants each region's revenue as a percent of total company revenue. Custom summary formula with PARENTGROUPVAL against GRAND_SUMMARY, Percent format.
4. Marketing wants month-over-month lead growth. Grouped by Created Date (month), summary formula using PREVGROUPVAL.
5. Support wants average cases per account across a joined report of Accounts and Cases. Cross-block custom summary formula.
6. Multiple reports and list views need the same calculation. This is NOT a report formula; create a Custom Formula Field on the object.

Exam Tips: Answering Questions on Custom Summary Formulas and Row-Level Formulas

Tip 1: Read for the level of calculation. The single most important discriminator is whether the question describes a calculation on each record (row-level) or on aggregated totals (summary). Words like "for each opportunity," "per record," "on every row" point to row-level formulas. Words like "total," "percentage of," "average across," "by region," "subtotal" point to custom summary formulas.

Tip 2: Watch for reusability clues. If the scenario says the value is needed in multiple reports, on page layouts, in list views, in validation rules, or as a filter or grouping, the answer is a Custom Formula Field, not a report formula. Report formulas live only within one report.

Tip 3: Know the trend and percentage functions. Any question mentioning "compared to the previous month/quarter" or "change from the prior period" is PREVGROUPVAL. Any question mentioning "percent of total," "share of grand total," or "contribution to parent group" is PARENTGROUPVAL. These two functions exist only in custom summary formulas.

Tip 4: Remember report type prerequisites. Custom summary formulas require grouping, so a tabular report is the wrong answer unless the question allows converting it to a summary report. Row-level formulas are not available in joined reports. Cross-block formulas exist only in joined reports.

Tip 5: Memorize the numeric limits. One row-level formula per report; five fields in a row-level formula; five custom summary formulas per report (per block in joined); ten cross-block formulas. Exam distractors often swap these numbers.

Tip 6: Know the output types. Row-level: Number, Text, Date. Summary: Number, Currency, Percent. If a question needs a text label calculated per row, only a row-level formula (or a formula field) can do it. If a question needs a percentage shown at the grand total, that is a summary formula with Percent format.

Tip 7: Lightning versus Classic. Row-level formulas are a Lightning Report Builder feature. If the scenario insists on Classic, row-level formulas are not an option, but custom summary formulas are available in both.

Tip 8: Eliminate bucket fields correctly. Bucket fields categorize existing values into named groups and can be used for grouping and filtering, but they do not perform arithmetic. If the question requires math, a bucket field is a distractor. If it requires categorizing ranges (e.g., Amount into Small/Medium/Large) and grouping by them, the bucket field is the answer, not a formula.

Tip 9: Think about "no changes to the data model." Questions frequently say "the administrator does not want to create a new field" or "without customizing the object." That phrase signals a report-level solution: row-level or summary formula, depending on the calculation level.

Tip 10: Display level matters. If the scenario specifies the value should appear "only at the grand total" or "only at the Region subtotal," recall that custom summary formulas let you choose where to display the result. This is a feature that custom formula fields do not have.

Tip 11: Dashboards and charts. Custom summary formulas can be used as chart and dashboard component values; row-level formulas cannot drive summary charts directly. If the question involves visualizing an aggregate ratio on a dashboard, the summary formula is the path.

Tip 12: Practice translating scenarios into formulas. Mentally write the formula: "Win rate by rep" becomes CLOSED_WON:SUM / CLOSED:SUM at the Owner level; "Days open per case" becomes TODAY() - DATEVALUE(CreatedDate) as a row-level Number formula. If you can write it, you can identify the tool.

Quick Review Summary

- Row-Level Formula: per-record, one per report, 5 fields max, Number/Text/Date, Lightning only, not in joined reports, lives only in the report.
- Custom Summary Formula: aggregated, up to 5 per report, Number/Currency/Percent, needs grouping (Summary/Matrix/Joined), supports PREVGROUPVAL and PARENTGROUPVAL, display level selectable, usable in charts.
- Cross-Block Formula: joined reports only, up to 10, references blocks like B1#FIELD:SUM.
- Custom Formula Field: object-level, reusable everywhere, stored in metadata, can be grouped and filtered.
- Bucket Field: categorizes values, groupable, no arithmetic.

Master the distinction between row versus summary level, memorize the limits, and recognize the PREVGROUPVAL and PARENTGROUPVAL use cases, and you will handle every question in this area of the Advanced Administrator exam with confidence.
Test mode:

Admin II - Custom Summary Formulas and Row-Level Formulas Example Questions

Test your knowledge of Custom Summary Formulas and Row-Level Formulas

Question 1

At Cloud Kicks, an advanced administrator maintains a summary report on opportunities grouped by Region, then by Close Month. Sales leaders want each monthly subtotal to show how much total Amount changed from the prior month within the same region. The figure must be correct whenever the report runs. A row-level formula the administrator tried only returned values on individual opportunity rows. Which approach meets the requirement?

Question 2

An advanced administrator at Ursa Major Solar is building an opportunity summary report grouped by region and then by owner. Sales leaders want each opportunity row to show the number of days between its created date and close date. They also want each owner's percentage of the region's total amount. A colleague proposes meeting both needs with row-level formulas. Which evaluation of this proposal is accurate?

Question 3

At Northern Trail Outfitters, an advanced administrator is building an opportunity report grouped by owner. Sales leadership wants to see each owner's average number of days between when an opportunity was created and when it closed. The administrator first tries a custom summary formula and finds that it offers only aggregated values, such as sums and averages, so the per-record date gap cannot be expressed. What should the administrator do?

More Custom Summary Formulas and Row-Level Formulas questions
24 questions (total)