---
schema_version: "1"
id: 5d9c9d86733d67fd0bbdbcc575c076344027469223f9b8d03d5635ff377f64e7
title: Create a Calculation for a Custom Metric
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_statement_design_metrics_custom_calculation.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_statement_design_metrics_custom_calculation.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7cff9dd45861e961a673b493a5ac7c499bee78d6dbca85cd246359bda3523f17
description: Along with the default and pre-built metrics, you can add custom metrics to statements. Any calculations that you create in Designer can be used as a metric card.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Create a Calculation for a Custom Metric

Along with the default and pre-built metrics, you can add custom metrics to statements. Any calculations that you create in Designer can be used as a metric card.

### 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: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</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="text-align:center;vertical-align:top;" id="d43559e78">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d43559e78 ">To create a custom metric with quotas:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d43559e78 ">
              <p>A Spiff <a href="https://help.salesforce.com/s/articleView?id=sales.spiff_users_roles_and_permissions.htm&amp;release=264.0.0&amp;type=5" title="Give users the appropriate level of access so they can be successful in Salesforce Spiff, and enforce the principle of least privilege. Assign a default role to each user, or create custom roles with access to specific Spiff functionality.">user role</a> with these permissions turned on.</p>
              <ul>
                <li>Designer Configuration: Manage</li>

                <li>Quotas: Edit</li>

              </ul>
            </td>

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

For this example, we’re creating a year to date (YTD) Deal Renewals Attainment statement metric that includes In Year Attainment with deal renewals only.

1. In Designer, under Plans, create a folder named Statement Metrics under the plan where you want to add the custom metric.
2. In the Statement Metrics folder, add another folder named YTD Deal Renewals Attainment.
3. Create a data filter that returns only deal renewals year to date.
    
    In this example, all of the data that we want to consider is on the Opportunities object, so we build the filter there. Before creating the filter from scratch, check to see if there are any existing filters that can be used. Make sure to filter by the specific rep, by deals that are closed, won, and renewed, and by the year selected.
    
    1. Click **Data**, and then click **Filters**.
    2. Select the **ClosedInYear** and **IsRenewal** filters.
        
        ![Selecting the ClosedInYear and IsRenewal filters](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_filters.png)
    3. Create the ClosedInYearRenewals filter in Settings, on the right side.
        
        ![Using the ClosedInYear and IsRenewal filters to create a ClosedInYearRenewals filter](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_filters_create.png)
4. Create a YTD Total Deal Renewals calculation.
    1. In Plans, click the three dots next to the YTD Deal Renewals Attainment folder and select **New Worksheet**.
        
        We use a worksheet because the calculation is a single data point.
    2. Name the worksheet YTDDealRenewalsAttainment\_Worksheet and add the headers Metrics and Quota Calculations.
        
        ![Creating a calculation to use in a metric](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_calculation.png)
    3. In the Metrics column, add a function that sums the ARR\_\_c field from the ClosedInYearRenewals filter. Enter \=sum(ClosedInYearRenewals!ARR\_\_c). Update the display name and display format.
        
        ![Adding a function for YTD total deal renewals](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_function.png)
5. Create data for renewals quota, which we use later in the calculation.
    1. In the YTD Deal Renewals Attainment folder, create a table named YTDDealRenewalsQuota.
    2. Add three reps, and fill out the table with the appropriate amounts.
6. Add the quotas data to the Create a YTD Total Deal Renewals calculation.
    1. Return to the YTDDealRenewalsAttainment\_Worksheet.
    2. In the Quota Calculations column, add a function that references the quota data. Enter \=quota("YTDDealRenewalsQuota"). Update the display name and display format.
        
        ![Adding quotas to a calculation](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_quotas.png)
    3. In a new row, divide YTDTotalDealRenewals by YTDDealRenewalsQuota. Enter \=YTDTotalDealRenewals/YTDDealRenewalsQuota. Give the calculation a name, and update the display name and display format.
        
        ![Final calculation for YTD deal renewal attainment](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/spiff/spiff_statement_design_metric_total.png)