The blacksmith's house: we crossed payroll, tasks, calendar and billing with AI

We crossed payroll, tasks, calendar and billing with AI and found clients who cost more than they paid. The method, the garbage-in rule and its limits.

Carlos Betancur Gálvez

By Carlos Betancur Gálvez

AI, digital marketing and medical marketing consultant · btodigital

When we crossed four data sources that had never talked to each other (payroll, tasks, calendar and billing), we found clients who were costing btodigital more than they paid. None of the four systems showed it on its own. It only appeared once we put them together.

On September 30, 2026, I told this story at the national congress of ACOPI, Colombia’s association of small and medium-sized businesses, in Bogotá. I framed it with a Spanish proverb turned on its head. The original is “en casa de herrero, cuchillo de palo”: in the blacksmith’s house, the knife is made of wood. Mine is in the blacksmith’s house, the knife is made of steel. I cannot stand on a stage talking about AI for decision-making unless I have used it first in my own company.

This is the third article in a series about how btodigital, the marketing agency I founded in Medellín, changed with AI. The first covered how our operations changed process by process and the second, the products that grew out of our own problems. This one is about something less glamorous and more uncomfortable: knowing what each client really costs you.

I wrote it for the manager who decides on gut feeling which client deserves more time. I used to do the same.

Why does gut feeling fail when deciding which client to prioritize?

Because the client who makes the most noise is not necessarily the one who leaves the most money. The one who calls every day, asks for meetings and replies fast feels like the most important. The one who pays on time and barely writes feels less important. Intuition locks in that impression.

Two pieces of research help me explain why:

  • With five variables at once, the brain guesses. In 2005, a group of Australian researchers (Halford and colleagues, in Psychological Science) measured how people interpret relationships between variables. With three they do fine, with four accuracy drops, and with five they do no better than chance. Deciding about a client means juggling hours, people, meetings, price and payment. That is five.
  • The whale curve. Robert Kaplan and V. G. Narayanan of Harvard (2001) showed that in many companies the best customers generate between 150% and 300% of profits, while the worst destroy much of what the others earn. If you do not know what each client leaves you, it is easy to pamper exactly the ones who lose you money.

We had the data to know. The problem was that it lived in systems that did not talk to each other.

What did we cross, and what does each source tell you?

SourceWhat it answersWhat it cannot answer alone
PayrollWhat one hour of each person costsWhich client that hour went to
Tasks (Bitrix)Which client each person worked onWhat that work cost
Calendar (Google Calendar)Which clients we meet with, and how oftenWhether those meetings are paid for
Billing (ERP)What we invoiced each clientWhat it cost to serve them

To give you a sense of volume: in September we closed 1,031 tasks, across 28 people, for 62 invoiced companies. Nobody crosses that by hand every month. With AI, you can.

What did we find?

First: we met a lot with some clients and hardly at all with others, and they paid about the same. You cannot see that in one person’s calendar. It shows up when you combine the whole team’s calendars and sort them by client.

Second: some clients cost us more than they paid. Every meeting is hours of people’s time, and every hour has a payroll cost. When we multiplied the hours (tasks and meetings) by that cost and compared it with what we invoiced each client, some came out in the red.

I will not publish figures for this. I did not show them at the conference, and I will not include them here either: they are client and company data that are not mine to make public. What matters to you is the method, not our numbers.

With that finding on the table, the conversation stops being “we need to work harder.” The options become different: renegotiate, change how the account is served or, in some cases, let the client go. None of the three is decided from the spreadsheet. They are decided after validating what is actually happening, which I explain below.

How do you do it in your company?

You do not need a custom system to start. With a spreadsheet and an AI assistant you can build the first version in a week. Here is the method:

1. Calculate the hourly cost of each person. Take what each person costs you per month (salary plus benefits and payroll taxes) and divide it by the hours they work in the month. Anonymize: the AI does not need anyone’s name, just a code and an hourly cost.

2. Pull hours per client from your task system. If your team logs time, use it. If not, use the number of closed tasks per client as a proxy and say so clearly in the analysis.

3. Pull meetings per client from the calendar. Duration times number of attendees. If meetings do not say which client they are for, that is the first thing to fix.

4. Pull invoiced amounts per client from your ERP for the same period. At least three months, so one odd month does not fool you.

5. Join everything on a common identifier. Names do not work, because every system spells them differently. Use the tax ID.

6. Ask the AI to sort and to propose hypotheses, not conclusions.

The minimum sheet has these columns:

Client (tax ID)Task hoursMeeting hoursCost of those hoursInvoicedDifference
Client A
Client B

And a prompt you can adapt:

I am attaching a table with, for each client, task hours, meeting hours, the cost of those hours and the amount invoiced over the last three months. Sort the clients by the difference between invoiced amount and cost. Flag the five with the worst ratio and the five with the best. For each of the worst, propose three possible explanations and the data I would need to check to confirm or rule them out. Do not give conclusions: give me hypotheses.

What is the garbage-in, garbage-out rule and why does it matter here?

In my Spanish-language AI talks I use an acronym, BEBE: Basura Entra, Basura Escupe, garbage in, garbage out. It names something engineers have known for decades: if bad data goes into the model, bad answers come out, and they come out sounding very sure of themselves.

In this kind of cross-analysis, the garbage has specific names. We know several of them because we suffered them with our commissions module, which crosses ERP billing with the team’s client assignments:

Data problemWhat it does to the result
The client has a different name in each system (trade name in tasks, legal name on the invoice)The join misses it and leaves it out
Clients with no tax ID loadedThey show zero invoiced even though they pay
Invoices in dollars mixed with local currencyA client paying in USD shows an absurd figure if added as if it were COP
Mixing invoiced with collectedA month looks red because the payment landed the next month
Meetings and tasks with no client assignedThat cost disappears and everyone looks more profitable

Before you read any result, check these five things. It will take longer than the analysis itself, and that is normal.

Correlation or cause?

At the conference I left one line on screen: “AI finds patterns. You validate the causes.”

A machine can cross thousands of data points and find relationships the eye cannot see. But among many variables, something will always line up by pure chance. The example I use comes from Tyler Vigen: the number of Nicolas Cage films released in a year correlates with the number of people who drown in swimming pools. Nobody believes one causes the other.

The same thing happens with clients, just less obviously:

Signal in the dataPossible explanationsHow to validate it
Many meetings, payment similar to othersClient in onboarding, account in crisis, poorly defined scope or a team habitLook at several consecutive months and talk to the account lead
Cost higher than invoicedOutdated price, scope that grew without adjustment or tasks logged to the wrong clientReview the contract and a sample of tasks
Very profitable client with little attentionWell-run account, or a client about to leave from lack of contactAsk the client how they see things

AI hands you the list of suspects. You confirm the cause, by talking to people and looking at the detail, before you renegotiate or let anyone go.

What we learned

There is no publishable number. I said it above and I repeat it because it is a real limitation: this article cannot show you how much we made or lost on each client. If you are looking for a figure, it is not here.

Invoiced is not collected. The ERP gives us invoiced amounts by month without trouble. But the tool we use to query it does not yet let us pull payments by date range, so the cross-analysis runs against invoiced amounts, not collected ones. For a client who pays at 90 days, a single month can look worse than it is.

Configuration matters as much as the formula. When the commissions module calculated against the ERP, it came out 9% below the manual calculation. It was not a formula error: we were applying today’s client assignments to past months. The same risk applies here: if you use today’s team to read costs from six months ago, you will get it wrong.

Not everything that matters lives in those four systems. A client who costs more than they pay may be the one who referred three others, or the one who taught you a new service. That does not show up in the table, and it has to go on the scale.

If after reading this you want to review how you measure client profitability, the same approach I used to measure where my leads came from applies here: your own data, an explicit method and written-down limits.

Frequently asked questions

How do you calculate client profitability in a services business? Add up the hours spent on each client (tasks and meetings), multiply them by each person’s hourly cost from payroll, and compare the total with what you invoiced that client in the same period. The difference is a first approximation of margin per client.

What data do I need to start? Four sources: payroll for hourly cost, your task system to see which client the work went to, the calendar for meetings and your ERP for invoiced amounts. Plus a common identifier, such as the tax ID, to join them.

What does garbage in, garbage out mean for AI analysis? If the data you give the AI is wrong (clients with different names, missing tax IDs, mixed currencies, tasks with no client), the answer will be wrong too, even if it sounds very confident. Cleaning the data usually takes longer than the analysis.

Can I upload payroll to ChatGPT or Claude? Anonymized and on a business plan. The AI does not need names: a code per person and their hourly cost are enough. Check the data protection law where you operate; in Colombia, payroll data is protected under Law 1581.

If a client costs more than they pay, should I let them go? Not necessarily. First validate the cause: it may be an outdated price, a scope that grew or tasks logged incorrectly. The options are to renegotiate, change how you serve them or, if none of that works, let them go.

How often should I repeat the analysis? Once a month, with at least three months of history behind each reading. That way one unusual month does not push you into a bad decision, and you can see whether your changes moved the number.

Share
Related posts