When creating a Salesforce Summary Report grouped by a picklist field, the standard record count only shows the count for each individual grouping value — not a running cumulative total. This article explains how to build a cumulative running total using a bucket column, a row-level formula with the CASE function, and a summary formula with PREVGROUPVAL.
This solution explains how to display a cumulative running record count at each grouping level in a Salesforce Summary Report, since the default group count only shows the total for each individual group rather than an accumulating total across groups. The steps below use Lead Status as the example grouping field, but the same approach applies to any report grouping — ideally a single picklist or checkbox field, since those have a fixed, known set of values that work well with formulas. If your grouping has more or fewer than 4 values, adjust the formulas accordingly.
By default, Salesforce sorts grouping values alphabetically. To control the order, create a bucket column.
Create as many buckets as you need for your statuses, naming them with a number in front so they sort in the order you want:
Click Unbucketed Values, select the first status, click Move to, and select "1-Open-Not Contacted." Repeat for each value, then click Apply.
Now group your report by this bucket column. If you want the highest value to have the smallest count, click the Bucket column header in the report to invert the sort order (the top group becomes "4-Closed-Not Converted"); otherwise leave it as-is.
Click the down arrow in the Columns section and select Add Row-Level Formula.
Give the formula a name and set it to return a number with no decimal points, then enter the formula below. This formula assigns a sequential number to each status — 1 for the first stage, 2 for the second, and so on — so the next formula can reference each group's position in order.
Tips:
CASE(STATUS, "Open - Not Contacted",1, "Working - Contacted",2, "Closed - Converted",3,4)
If you have 5 values instead of 4, extend the formula like this:
CASE(STATUS, "Open - Not Contacted",1, "Working - Contacted",2, "Closed - Converted",3, "Value4",4,5)
Click the down arrow in the Columns section and select Add Summary Formula.
Enter the formula below, set to return a number with no decimal points. This formula adds the current group's row count to the running total of every prior group, using PREVGROUPVAL to look back at each earlier group's count — that's what produces the cumulative total instead of a per-group count.
RowCount+ CASE(CDF1:AVG, 4,0, 3,BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980),0), 2,BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980,2),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980),0), BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980,3),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980,2),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_60270980),0))
Tips:
If you have 5 values instead of 4, extend the formula like this:
RowCount+ CASE(CDF1:AVG,5, 0, 4,BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257),0), 3,BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,2),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257),0), 2,BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,3),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,2),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257),0), BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,4),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,3),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257,2),0)+BLANKVALUE(PREVGROUPVAL(RowCount,BucketField_52627257),0))
While still in the formula window, click the Display tab, select the Specific Groups level, choose your bucket column grouping, and click Apply.
Here's an example of the finished report (with details hidden): the Row-Level Formula average is shown in green, the record count for each specific status is shown in blue, and the cumulative aggregated record count is shown in red.
000393469

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.