---
schema_version: "1"
id: 95856ed2562c14be443589ba442b490258c4a7d7d3dfbf67eb814619364185ec
title: PREVGROUPVAL
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_prevgroupval.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_prevgroupval.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 65af09e330d2be38e73efa65e6d9298aa35889d417980a98f857fe6bb6a2f47b
description: This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# PREVGROUPVAL

This function returns the value of a specified previous grouping. A “previous” grouping is one that comes before the current grouping in the report.

Choose the grouping level and increment. The increment is the number of columns or rows before the current summary. The default is 1; the maximum is 12. You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.

## Use

```
PREVGROUPVAL(summary_field, grouping_level [, increment])
```

Where `summary_field` is the name of the grouped row or column, `grouping_level` is the API name of the peer level group whose summary value for the previous grouping is used, and `increment` is the number of groupings previous.

In reports with multiple grouping levels, you can specify the `grouping_level` to be the same group level as the formula display level or a group level higher than the formula display level.

![Formula Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Formula Example

```
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
```

This formula calculates, for each month, the difference in amount from the previous month shown in the report. In this example, the report is an opportunity matrix with columns grouped by Close Date and rows by Stage.