The challenge
For a Croatian frozen food distributor serving hundreds of HORECA and retail customers, churn was silent. A hotel ordering €3,000 a month would quietly fade over a quarter - and by the time the decline surfaced in monthly spreadsheet reviews, 3–6 months of revenue was gone and a competitor had locked in the account. The hardest part: on the Dalmatian coast, where HORECA revenue swings 5–10x with the tourist season, a hotel closed for winter and a hotel lost to a competitor look identical in the raw invoice data.
The solution
Margins built a real-time sales anomaly detection system running inside the client's own ERP environment — no cloud, no data leaving the company. The system analyzes four years of invoice history through 11 specialized detectors covering churn risk, revenue decline, product mix shifts, pricing pressure, and behavioral change, with five layers of seasonal intelligence calibrated to the coast's extreme patterns. Every morning, the sales team gets a prioritized alert list ranked by revenue at risk, each alert with a plain-language explanation of what's happening and why. Validated against historical data, the system flags 94.7% of all revenue losses — €3.7M annualized — with a median early warning of 43 days before a customer's final order. Not a churn post-mortem: a six-week window to save the account.
Results
- 94.7% of historical revenue losses detected
- 43-day median early warning
- €3.7M annualized losses identified
- Runs inside the existing ERP

Where could AI create the most value in your business?
Start with a conversation. We'll learn how your business operates, explore where AI could create meaningful value, and help determine which opportunities are worth pursuing.
Talk to our teamNo predetermined solution. No technology looking for a problem.







