---
schema_version: "1"
id: e2ce1ef43d510db254424271affb2c96520fe7cc4e7802d719e03ae0d9dfb168
title: Calculate Values Relative to a Parent or Peer Group
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/reports_enhanced_summary_formulas.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.reports_enhanced_summary_formulas.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a353f097a13127cbe346f0fbf7747328c9aebe87a80d13d357c0ee1c8b21a163
description: You can add a formula that calculates values relative to a parent or peer grouping in a Lightning report. PARENTGROUPVAL calculates values relative to a parent grouping. PREVGROUPVAL calculates values relative to a peer grouping. For example, calculate the proportion of total opportunity amounts from each lead source, or compare sales each month to the previous month.
products:
  - Cross Cloud
release: "264"
---
# Calculate Values Relative to a Parent or Peer Group

You can add a formula that calculates values relative to a parent or peer grouping in a Lightning report. PARENTGROUPVAL calculates values relative to a parent grouping. PREVGROUPVAL calculates values relative to a peer grouping. For example, calculate the proportion of total opportunity amounts from each lead source, or compare sales each month to the previous month.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enhanced Folder Sharing</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="vertical-align:top;" id="d62994e88">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d62994e88 ">To create, edit, and delete reports:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d62994e88 ">
              <dl>

                <dt style="font-weight:bold;padding-top:.25rem;">Enhanced Folder Sharing</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Create and Customize Reports <p>AND</p>
                  <p style="margin-bottom:0;">Report
                    Builder</p>
                </dd>

              </dl>
            </td>

          </tr>
        </tbody>
      </table>

1. Edit or create a report that has at least one row grouping and optionally one or more column groupings.
2. From the Columns section in the report builder, click **![the column actions icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-analytics-264-0-0-production-enus/295fead5-b71d-4e1c-9886-4af4d53400b6/resources-global/_corporate/images/dropdown.png)** and select **Add Summary Formula**.
3. Enter a column name.
4. Select the formula output type.
5. In the left panel, select **Functions**.
6. Select **PARENTGROUPVAL** or **PREVGROUPVAL**.
7. In the Display panel, select a specific grouping or groupings (1).
8. In the Function panel (2), select the grouping or groupings to use in the function.
    
    The available groupings depend on what you selected in the Display area.
    
    ![Edit Summary Formula window with numbered callouts](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-analytics-264-0-0-production-enus/295fead5-b71d-4e1c-9886-4af4d53400b6/analytics/images/rd/rd_enhanced_summary_formula_3.png)
9. To add the function to your formula with the selected parameters included, click **Insert**
    
    ![Edit Summary Formula window showing the PARENTGROUPVAL function inserted in the formula area](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-analytics-264-0-0-production-enus/295fead5-b71d-4e1c-9886-4af4d53400b6/analytics/images/rd/rd_enhanced_summary_formula_4.png)
10. Add other parameters, functions, and operators to the formula as needed.
    
    ![Edit Summary Formula window showing a completed formula with PARENTGROUPVAL](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-analytics-264-0-0-production-enus/295fead5-b71d-4e1c-9886-4af4d53400b6/analytics/images/rd/rd_enhanced_summary_formula_5.png)
11. To check the formula, click **Validate**.
12. To close the formula builder and add the summary formula column to the report, click **Apply**.