The Triple-Counted Deal
RevOps MysteryAn AE pings Slack: "Why does this opp show $450K ARR?" The deal is only $150K/year. The ARR field is fine on most opps, so what's different about this one? This is the story of how a single wrong number uncovered a formula + Flow design flaw that had been silently tripling revenue on every ramping contract in the org for 14 months — $2.1M in phantom pipeline.
The Slack Message
Hey — quick one. On the Meridian Health opp, the ARR field shows $450K but I'm pretty sure the deal is only like $150K/yr. Most opps look fine so IDK what's different about this one. Can you take a look?
Don't have time to dig into this rn. Forwarding to Claude — it'll figure out what's going on with the OLIs and the rollup. If it's a formula issue it'll fix it.
The Prompt
Copy-pasted the Slack thread into Claude Code. Two minutes of effort.
Hey — quick one. On the Meridian Health opp (006Dn000003xK9PIAU), the ARR field shows $450K but I'm pretty sure the deal is only like $150K/yr. Most opps look fine so IDK what's different about this one. Can you take a look and figure out what's going on? If it's broken, fix it.
The RevOps Panic Moment
"Most opps look fine" is the scariest phrase in RevOps. It means the bug is conditional — it only fires on certain deal structures, which means it's been hiding in plain sight. When the number is 3x, the question isn't "is this one opp wrong?" — it's "how many board decks have we sent with phantom revenue?"
How Claude Code Handles This
Inspect
Pull the Opportunity and its line items to see what the data actually looks like
Trace the Formula
Read the OLI formula field and the rollup to understand how ARR is calculated
Find the Pattern
Query the org for other opps with the same multi-line stacking pattern
Trace the Flow
Pull the ARR calculation Flow and find where it blindly trusts the rollup
Fix Formula + Flow
New OLI formula for current-year detection, redesigned Flow for smart grouping
Backfill & Prevent
Recalculate all affected opps, add a validation rule to catch future stacking
"ARR shows $450K on a deal that should be ~$150K/yr. Let me pull the opp and its line items to see what's actually in there..."
"There it is. The rep quoted this as three annual line items — one per year with a ramp — instead of a single line with a 36-month term. Each line has Term = 12 months, so the annualization formula treats each one as a standalone annual subscription. The rollup sums all three: $140K + $150K + $160K = $450K. That's the full TCV, not the ARR."
"The OLI formula is Annualized_Amount__c = TotalPrice * 12 / Service_Term_Months__c. When Term = 12, it just passes through TotalPrice. Correct per-line, but the rollup treats sequential annual lines as concurrent subscriptions. Now the question: is this one rep, or a pattern?"
"23 opportunities. $2.1M in over-reported pipeline. This has been happening silently. Let me check how long..."
"14 months of triple-counting. The pattern started right after the new quoting template was rolled out in November 2024. The template encouraged reps to break multi-year ramps into annual lines for finance visibility — but nobody checked what that does to the ARR rollup. Now I need to understand the full calculation chain before I fix it."
The Anatomy of a Triple-Count
How it should work
What the rep did
The formula is correct per-line. The rollup can't distinguish sequential years from concurrent subscriptions. The Flow blindly trusts the rollup.
OLI formula: Annualized_Amount__c = TotalPrice * 12 / Service_Term_Months__c — annualizes each line independently. Correct per-line, blind to sibling lines.
Opportunity rollup: ARR__c = SUM(OpportunityLineItem.Annualized_Amount__c) — sums ALL line items. Cannot distinguish concurrent vs. sequential lines.
Flow logic: When ARR__c changes → propagate to Account.Total_ARR__c with SUM of child Opportunity ARR values. The Flow blindly trusts the rollup. No grouping, no date filtering, no stacking detection.
"The full chain: OLI formula annualizes each line → rollup sums them all → Flow propagates inflated ARR to Account. Three components, and the bug lives between the formula and the rollup. The formula can't see sibling OLIs (Salesforce limitation — no cross-object OLI-to-OLI references in formulas). The rollup can't filter by date. So the fix has to live in the Flow."
The Root Cause
Salesforce OLI formulas cannot reference sibling line items — each OLI is an island. The Annualized_Amount__c formula works perfectly for its own line, but it has no way to know that two other lines represent Year 2 and Year 3 of the same contract. The rollup summary field sums everything. The Flow propagates the inflated sum to the Account. Three components, each correct in isolation, producing a 3x overcount when the deal structure changes. The quoting template change in November 2024 encouraged reps to break ramps into annual lines for finance visibility — but nobody checked what that does downstream.
"Two-part fix. First: a new formula on OLI to flag which line is the current-year line. Second: redesign the Flow to group OLIs by product, detect stacked annuals, and only count current-year amounts."
New OLI formula: Is_Current_Year_Line__c
New OLI formula: Effective_ARR__c
Redesigned Flow: Calculate_Opportunity_ARR
Validation Rule: Stacked_Annual_Lines_Warning
Formula + Flow + validation rule deployed to production.
"Flow is live for new changes. Now I need to recalculate ARR on all 23 affected opportunities and their parent Accounts..."
Backfill complete. All 23 opportunities and 14 accounts corrected. Pipeline ARR reduced by $2.1M to accurate numbers.
What Shipped
Is_Current_Year_Line__c
OLI Formula · New
Flags the line item whose service window includes today. Enables the Flow to distinguish "this year's revenue" from future-year lines on the same opp.
Effective_ARR__c
OLI Formula · New
Zeroes out non-current-year lines so only active revenue contributes to ARR. Single-line deals pass through unchanged.
Calculate_Opportunity_ARR
Record-Triggered Flow · Redesigned
Moved trigger from Opportunity to OLI. Groups lines by product, detects stacked annuals, sums only current-year amounts. Propagates corrected ARR to Account.
Stacked_Annual_Lines_Warning
Validation Rule · New
Soft warning when a rep adds a duplicate product line. Suggests using a single line with the full contract term instead. Doesn't block — just educates.
Before & After
The RevOps Win
A "quick one" from an AE turned into $2.1M of phantom pipeline that had been inflating ARR reports for 14 months. The bug was invisible on standard deals and only fired on ramping contracts — exactly the kind of deal structure you want your reps creating. The OLI formula was correct per-line. The rollup was doing what rollups do. The Flow trusted both. Three correct components producing a wrong answer. Diagnosed, fixed, backfilled, and prevented — all from a forwarded Slack message.
Try This Workflow
Next time a number looks wrong, forward the Slack message. Let Claude trace it.