Back to the blog

Your AI agent needs to know how your company calculates each metric

How to write the revenue, active customer and margin definitions your AI agent uses, test them on a closed month and keep them up to date

Juan Miguel Jiménez P. · November 30, 2026 · 6 min read

Illustration of an AI agent card linked by thin lines to three stacked blue cards, each with a green check mark, next to a report with a bar chart and a rising sun in the background

At your company, do Sales and Finance calculate monthly revenue with the same rule?

Picture the month-end leadership meeting. Sales brings one revenue number for June and Finance brings another, lower one. When they go through the orders, they see that Sales counted canceled orders and didn't subtract returns, while Finance left out the canceled orders and subtracted the returns. It's a made-up example, though you've probably been through it with two spreadsheets that wouldn't reconcile. Sound familiar?

Now put an AI agent that queries your data at that table. The CEO asks it for June revenue. The agent queries the orders database, adds up every order for the month and hands back a number with no caveat at all. Which rule did it use? The one it assumed, because nobody gave it yours.

An AI agent calculates with the rule it assumes when your company doesn't give it one

In the example, the company defines revenue as net sales: canceled orders excluded, discounts and returns subtracted. The agent added up every order because that rule never reached it.

The word "revenue" seems clear until someone has to calculate it. dbt Labs, a data software company, shows this with "monthly revenue," which can mean revenue recognized in the month, revenue billed that month, revenue from contracts starting that month or revenue net of returns. To me, all four readings are reasonable, and if Sales uses one and Finance another, their numbers contradict each other. What your company decides is which one counts when the number reaches leadership.

This was already true of any reporting system. With an agent it can happen faster: it answers in seconds and, if nobody gave it the rule, it delivers the number without saying it made an assumption.

The June revenue example: the agent added up every order, including canceled ones and without subtracting returns, compared with the net sales the company reports

Onboard your AI agent the way you would onboard a new Finance analyst

Think about how a new analyst starts in Finance. Someone explains what counts as revenue, when a customer stops being active and how margin is calculated. Someone reviews their first reports before they reach leadership. And every time a policy changes, someone tells them.

I suggest doing the same with an AI agent: write the definitions, test them against a closed month and keep them current. All three steps call for knowing how your business works, which is exactly what the agent doesn't come with.

Write down what counts as revenue, active customer and margin, with an owner for each definition

I would start with these three metrics. That's my call, and your company can swap in the ones that matter most to its leadership team:

  • Revenue. Define which sales count, what gets deducted and on what date each sale is recorded. An order placed at month-end and invoiced on the 2nd changes the number for both months.
  • Active customer. Define how many months without a purchase go by before a customer stops counting as active, and whether someone who only asked for a quote counts.
  • Margin. Define whether it's calculated with cost of goods sold only or with operating expenses too.

I would give each definition an owner with a name and a title, usually in Finance, and let that person have the final say when two departments disagree. dbt Labs recommends something very similar for agents that query data: document each metric with its calculation, its business context and its owner.

The three definitions in step one: which sales count as revenue, when a customer stops counting as active and which costs go into margin

Before the agent answers leadership, compare its calculation with the official report for a closed month

Writing the definition doesn't guarantee the agent will use it well. Microsoft says as much in its guide to preparing Power BI data, its reporting tool, for use with Copilot: the model only interprets the instructions you write, and there's no guarantee it will follow them exactly. The sample instruction in that guide is almost the one in this article: net sales after discounts and returns, excluding canceled orders.

That's why you test the definition. Take a month that's already closed, whose official result your team knows, and ask the agent the questions leadership would ask. If the revenue it calculates matches the official report, you're on track. If it doesn't, you know which definition to review, and you found out before leadership did.

The person who tests is the owner who signs off on that number in the leadership report. I would ask the agent for two things: show the data and the steps it used, and say so when the data isn't enough to answer. An agent that says "I can't calculate this with the data I have" saves you more trouble than one that hands over a number anyway.

Step two: the owner who signs off on the number tests the agent with questions about a closed month, and the agent shows its data and steps and flags when the data falls short

Update the definition every time a business rule changes, because your agent keeps calculating with the old one

A new analyst hears about a new policy in a meeting or in the hallway. The agent only knows what's written down, so it keeps using the old rule until someone changes it.

A new discount or returns policy changes how revenue is calculated. A new product or sales channel forces a decision on whether its sales count as revenue. And a new way of recording costs changes margin.

dbt Labs recommends that every change to a metric definition have clear owners and go through an approval process. At a midsize company I would start simple: the owner approves the change, you note the date it takes effect and you rerun the closed-month test.

Step three: a commercial change, a change in what you sell and an accounting change all require updating the definition, with the box for the CEO

Writing, testing and maintaining the definitions is your company's job, whatever AI vendor you use

If you're evaluating an AI agent, this one is on you. Tools like Power BI already give you a place to write the definitions, and your Finance team sets the calculation rules.

Back to the leadership meeting from the start. With revenue defined, tested against a closed month and up to date, the agent would have arrived with the same number as Finance, and leadership would have spent its time deciding what to do with that revenue. If I had to start with a single definition, I would start with revenue, with its owner in Finance.

If you'd like to talk it through, happy to.

The rules and recommendations in this article come from these sources

  • Microsoft Learn, May 28, 2026. Prepare your data for AI, AI instructions. Guide to Copilot in Power BI with the sample instruction on net sales and the warning that the model interprets instructions with no guarantee it will follow them exactly. The feature is listed as a preview.
  • dbt Labs, April 21, 2026. Metric definitions for AI agents. The four possible readings of monthly revenue, the contradictory results when two departments pick different definitions, the recommendation to document each metric with its calculation, context and owner, and the recommendation to approve every change to a definition.
  • The June revenue example is hypothetical. The new analyst onboarding, the three steps, the closed-month test, what you ask the agent during the test and how fast a wrong number can reach leadership are Uhorizon AI's own approach.

Want to see how this applies to your company?

In 30 minutes we look at what stage your company is in and where it makes sense to start.