Admins

Compare Field Values in Salesforce Reports (with Field-To-Field Filters)

By Bart Lont

Have you ever needed to compare two fields in a Salesforce report? Field-to-Field Filters in Salesforce make it possible to compare values in different fields contained on a Salesforce report when defining report filter criteria – for example, only show me records where X field is greater than Y field.

In this guide, I will show you a Field-To-Field Filters example comparing “Total Donations This Year” and “Total Donations Last Year”. By the end, I am sure you will have thought of many other ways you can use these special filters in your Salesforce reports.

Read more: How to Create a Report in Salesforce

Field Comparisons with Field-To-Field Filters

  • While editing a report, select the ‘Filters’ tab. Then choose a field from the ‘Add filter…’ lookup.
  • If the field you chose to filter on supports field-to-field filters, then set the Type dropdown to ‘Field’ (if the field does not support field-to-field filtering then the Type dropdown does not appear).
  • Choose the Operator and select the field that needs to be compared with.

Let’s take a look at this in practice.

Suppose you have these two fields on the Contact object:

  • Total Donations This Year
  • Total Donations Last Year

At the moment, your report looks like this:

You only want to select donors that donated more this year than they did last year. Click ‘Edit’ on the report and add a new filter:

In this filter, you compare Total Donations This Year with Total Donations Last Year. Do you spot the difference? Instead of selecting a numeric value for ‘greater than’, you now select a field value, namely, the value of ‘Total Donations Last Year’.

This is the result:

Considerations for Using Field-To-Field Filters

  • Field-To-Field comparisons only work on these types of fields: Numeric, Currency, Date and Datetime.
  • You can only compare fields of the same data type (in our example, we made a comparison between two currency fields)
  • In a report, you can have up to four Field-To-Field filters.
  • This only works in Lightning Experience.

What are you going to use Field-To-Field Filters for in your org? Let us know in the comments below.

The Author

Bart Lont

Bart has been a Salesforce enthusiast since 2018 and is currently working as an admin for a Dutch non-profit organization.

Comments:

    BIDtravel
    September 06, 2021 2:22 pm
    Very useful. I was wondering, is there a way to get a report based on field changes? I have some custom fields that changed its value because of an integration. I would need to find the records affected with these fields changed.
    Mary F
    September 21, 2021 2:42 pm
    Run a History report on the object where your fields are found. ie: Account History This will show Old Value and New Value and you can sort by Edit Date.
    Ali
    April 27, 2022 12:49 am
    Is it possible to use field to field filters when one field is on an opportunity and one field is on an account (aka cross-object field filters)? I have two date fields (one on the opp and one on the account) and it won't let me select the account field when I start on the opp field and vice versa
    Amanda
    August 26, 2022 1:56 pm
    Doesn't look like it supports a joined report.
    Neha Jain
    September 03, 2022 5:39 pm
    I was really looking for this feature, because due to it many times a custom query is required to return the results.
    Abhinav
    January 20, 2023 1:44 pm
    I am unable to find that field section in the filter. Can anyone help me how to enable that option?
    Gaylene Dickens
    May 15, 2023 10:02 pm
    I couldn't get this work with my currency fields on the opportunity split report - the option is available on the age field. We have multi-currency enabled wondering if that's the issue.

Leave a Reply