We created 10 basic formulas to help you get started with Salesforce KPIs. Since you can import custom data from Salesforce to Plecto, not all formula examples can be generic. That's why we only prepared formulas based on the standard data types – those that are the same for everyone:

Salesforce Leads, Salesforce Opportunities, Salesforce Tasks

Copy and paste these formulas in the advanced formula editor (open advanced editor), then switch to the visual editor for better usability. If you use the formulas and something doesn't seem to be working, make sure to adjust formulas based on the data source and field names in your organization.

Are you looking for more formula examples?

Leave your feedback at the bottom and let us know what formulas we should include in the article!

Count the number of new leads in Salesforce. The formula below will count the number of new leads based on the default date field in the data source (for example, Created date). Add a date modifier if you want the formula to calculate based on a different date field (for example, Updated date).

Data source: Salesforce Leads
Number format: Decimal number

(
   Count(Salesforce Leads,Status of the Lead="New Lead")
)

See how many opportunities you have in Salesforce. The formula below will count the number of opportunities based on the default date field in the data source (for example, Created date). Add a date modifier if you want the formula to calculate based on a different date field (for example, Updated date).

Data source: Salesforce Opportunities
Number format: Decimal number

(
    Count(Salesforce Opportunities)
)
Tip – Use the same formula on different widgets to extract different metrics

Add this formula to widgets that support custom grouping, and see your opportunities by stage, type, source, and more. You don't have to create separate formulas to drill down different metrics.

To see the number of won Salesforce opportunities, you need to add a filter that counts only the "Closed Won" registrations and a date modifier to see metrics that are based on the actual close date.

Data source: Salesforce Opportunities
Number format: Decimal number

(
    Count(Salesforce Opportunities,Stage="Closed Won").Date(Close Date)
)

This formula sums the amount of all opportunities that are closed won. Feel free to add a prefix or suffix such as $ or USD to make your metrics easier to understand.

Data source: Salesforce Opportunities
Number format: Decimal number

(
    Sum(Salesforce Opportunities,Stage="Closed Won",Amount).Date(Close Date)
)

To see the number of lost Salesforce opportunities, you need to add a filter that counts only the "Closed Lost" registrations and a date modifier to see metrics that are based on the actual close date.

Data source: Salesforce Opportunities
Number format: Decimal number

(
    Count(Salesforce Opportunities,Stage="Closed Lost").Date(Close Date)
)

This formula sums the amount of all opportunities that are closed lost. Feel free to add a prefix or suffix such as $ or USD to make your metrics easier to understand.

Data source: Salesforce Opportunities
Number format: Decimal number

(
    Sum(Salesforce Opportunities,Stage="Closed Lost",Amount).Date(Close Date)
)

There are different ways how to calculate a sales win rate. The formula depends on what metrics your business wants to see. Here's a basic formula that divides the number of won deals by the number of won and lost deals.

Data source: Salesforce Opportunities
Number format: Percent

(
    Count(Salesforce Opportunities,Stage="Closed Won").Date(Close Date)
    /
    (
        Count(Salesforce Opportunities,Stage="Closed Won").Date(Close Date)
        +
        Count(Salesforce Opportunities,Stage="Closed Lost").Date(Close Date)
    )
)

Same as with the win rate, the conversion rate formula depends on your needs and what metrics you want to include in the formula. This formula divides the number of won deals by the number of leads.

Data source: Salesforce Leads, Salesforce Opportunities
Number format: Percent

(
    Count(Salesforce Opportunities,Stage="Closed Won").Date(Close Date)
    /
    Count(Salesforce Leads)
)

Count the number of Salesforce tasks. All formulas in Plecto are versatile – add this formula to widgets that support custom grouping and see tasks by status, priority, and more. You don't have to create a separate formula to drill down different metrics.

Data source: Salesforce Tasks
Number format: Decimal number

(
    Count(Salesforce Tasks)
)

To get the number of completed tasks, add a filter that makes Plecto calculate only those registrations where the status says "completed." Change the date field to Completed Date to get the most accurate metrics.

Data source: Salesforce Tasks
Number format: Decimal number

(
    Count(Salesforce Tasks,Status="Completed").Date(Completed Date)
)

Was this article helpful?

Please leave a comment to help us improve.