Sub topic 12
Reporting on lead conversion
This chapter assumes you can build a basic report in Report Builder and that you know what happens when a lead converts. That means the account, contact, and optional opportunity it creates, and the converted status it receives. It also assumes you can read a simple SOQL query.
What conversion leaves behind
A converted lead is not deleted. It stays in the Lead object with IsConverted set to true and keeps references to the records created during conversion. These references make conversion reporting possible:
| Field | What it holds |
|---|---|
| Converted (`IsConverted`) | Checkbox that is true after conversion |
| Converted Date (`ConvertedDate`) | The date the lead converted |
| Converted Account (`ConvertedAccountId`) | The account created or matched |
| Converted Contact (`ConvertedContactId`) | The contact created or matched |
| Converted Opportunity (`ConvertedOpportunityId`) | The opportunity, if one was created |
Converted leads are hidden from the standard Leads list views. Reports and SOQL queries can still reach them.
Choosing a report type
Salesforce provides two standard report types for this work.
- Leads reports on the Lead object alone. Use it for volume, source, status, and conversion counts.
- Leads with converted lead information adds the converted account, contact, and opportunity. Use it when you need to know what a lead became, such as the opportunity amount or stage.
Add an explicit filter on Converted (equals True or False). Do not rely on defaults, or open and converted leads can end up mixed in one total.
Building a conversion-rate report
A conversion rate is the number of converted leads divided by the total number of leads in a group. A simple, reliable approach is a formula field on Lead.
- Create a Number formula field called
Converted Numberwith this formula:
IF(IsConverted, 1, 0)- Create a Leads report in summary format.
- Filter Created Date to the period you want to measure, for example This Quarter.
- Group rows by Lead Source.
- Add
Converted Numberas a column and summarize it with Average.
The average of 1s and 0s is the conversion rate for each source. Group by Owner instead of Lead Source to compare how well each rep or queue-fed team converts. Because assignment rules decide ownership, this shows whether your routing is working.
A second option needs no custom field. Build a matrix report with Lead Source in the rows and Converted in the columns, then show Record Count. You can read the two counts directly, but you get no single percentage.
Measuring time to convert
To see how long leads take to convert, add a formula field of type Number:
ConvertedDate - DATEVALUE(CreatedDate)ConvertedDate is a date and CreatedDate is a date/time, so DATEVALUE makes the types match. Filter the report to Converted equals True, because the field has no meaningful value for open leads. Then summarize the field as Average, grouped by Lead Source or Owner.
Querying with SOQL
You can query the same data directly. This query from the spine lists the most recent conversions along with the records they created:
SELECT Id, Name, ConvertedDate, ConvertedAccountId, ConvertedContactId, ConvertedOpportunityId
FROM Lead
WHERE IsConverted = true
ORDER BY ConvertedDate DESC
LIMIT 10To count conversions by source, use an aggregate query:
SELECT LeadSource, COUNT(Id) total
FROM Lead
WHERE IsConverted = true
GROUP BY LeadSourceCommon reporting errors
- Counting by Created Date versus Converted Date. A lead created in March and converted in May appears in March if you filter on Created Date. Filter on Converted Date to count conversions in a period. Filter on Created Date to measure how well a cohort of leads converts. State which one you used.
- Mixed totals. Without a Converted filter, open and converted leads are added together.
- Visibility. Report results follow sharing rules, so a user may see only their own leads. A conversion rate built by a restricted user can differ from the company-wide figure.
- Blank Lead Source. Leads with no source form their own group. Make the field required, or at least check for the blank group.
Exercise
A manager wants to know how many leads created in January converted, regardless of when they converted. Which date field should the report filter on, and which Converted filter should it use?
Show answer
Filter on Created Date for January, and set the Converted filter to True. Created Date selects the January cohort, and Converted equals True counts those that later converted. Filtering on Converted Date would instead count leads that converted in January, whenever they were created.