> ## Site Index
> Fetch the site index at: https://www.credibledata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do you get every team to agree on one number for each metric?

> Why two reports show different revenue for the same month, and how one written definition per metric, read by every report and AI agent, gets teams to agree.

## Why do two reports show different revenue for the same month?

Each report uses its own definition, and the data supports more than one. On a Brazilian ecommerce dataset, four defensible revenue totals spread 18.6%, mostly over whether shipping counts ([How an agent builds a data model and shows its work](/blog/posts/how-an-agent-builds-a-semantic-model)). Two of them, simplified and written as [Malloy](/malloy) definitions:

```malloy
dimension: counts_as_sale is order_status != 'canceled' and order_status != 'unavailable'

measure:
  #(doc) Everything charged, including shipping and cancelled orders
  gross_revenue is order_items.price.sum() + order_items.freight_value.sum()

  #(doc) Merchandise only, excluding cancelled and unavailable orders
  net_product_revenue is order_items.price.sum() { where: counts_as_sale }
```

Side by side, the difference is plain: shipping, and which orders count. When each definition is a few named lines, spotting the conflict is easy. When each lives inside a 100-line SQL query in a different dashboard, the difference is one filter or one added column somewhere in the middle, and finding it takes much longer.

None of these totals is an arithmetic mistake. When each team writes its choice into its own dashboard, spreadsheet or query, nothing makes the copies agree, and nothing shows when they don't. An AI agent with no written definition picks one each time it's asked. For mismatches that aren't about the definition, see [Why don't AI answers match our dashboards?](/guides/why-ai-numbers-dont-match-your-dashboard)

## How do I find the metric definitions that already conflict?

Start from what people actually query, not from every field that exists. Your warehouse and BI tools log every query: Snowflake's query history, BigQuery's job history, Looker's System Activity. Credible [records](/docs/platform-admin/monitoring) every Malloy query too, from the app, MCP clients and the API. Those logs show which fields and calculations are in use, and the job shrinks to those.

- **The fields.** In the logs and in the dashboards, find each metric that turns up with two definitions. That is a conflict.
- **The questions.** Answer the questions people ask most, such as last month's revenue, from every dashboard, saved query and spreadsheet that claims to. Where the answers differ, two definitions are in play.

## How do you settle a conflict?

The data can't settle it. The person who answers for the number decides: finance for revenue, the support lead for response times. When two definitions are each right for a different team, such as gross revenue for marketing and net revenue for finance, keep both under their own names, and make one the default for when someone just says "revenue".

You can also decide who sees which. In a Malloy model, each audience can query its own source that shows only the fields it needs: finance's source shows net revenue alone, while analysts see every definition. An agent asking for someone in finance then can't pick the wrong revenue, because it's the only one there. [Curate What Your Agents See](/blog/posts/curate-what-your-agents-see) shows how.

## How should changes to a metric definition get approved?

A definition change is a code change, so code review is the right process. Someone proposes the change, an agent or a person checks it against the data, the metric's owner approves the pull request, and merging publishes it. Every change records who asked for it and who approved it.

Each change also runs against an eval: the questions from your survey, each with the answer its owner settled on. A change that moves one of those answers by accident fails before it ships. A change that moves one on purpose updates the answer in the same pull request. [Your Data Model Is Part of Your AI System](/blog/posts/data-model-evals) shows how the open-source eval skills build and maintain the list, and [How to measure text-to-SQL accuracy](/guides/text-to-sql-accuracy) covers judging answers.

## How should a team start getting to one definition per metric?

Pick the metric people argue about most. Settle it with the person who answers for it, write it into the model, and add its question to the eval.

[Malloy](/malloy) and [Malloy Publisher](https://github.com/malloydata/publisher) are open source and MIT-licensed. A model is a set of text files in your own repository, and Publisher serves it to agents, with the [eval skills](https://github.com/malloydata/publisher/tree/main/skills) in the same repository.

[Credible](/) runs the same models as a managed service. In a [git-backed environment](/docs/how-to/modeling/git-backed-environments), the person who owns a number asks an agent for a change in plain language, each publish opens a pull request for your reviewers, and merging publishes the new version to every agent, data app and dashboard. [Version control for the people who own the numbers](/blog/posts/version-control-for-the-people-who-own-the-numbers) walks through an example. See [pricing](/pricing).

## Frequently asked questions

### Our numbers live in dashboards, saved SQL and spreadsheets, and nobody agrees which is right. How do we get to one source of truth?

List the metrics those dashboards, queries and spreadsheets actually use, and find the ones defined more than one way. For each, the person who answers for the number picks one definition. Write it in one data model that every report and AI agent reads, instead of in each tool. Then send every change through review, so a definition changes only when its owner approves.

### How do I stop AI agents from using the wrong metric definition?

Connect the agent to the data model instead of straight to the tables, so it reads each metric's definition rather than writing its own. A model only covers the words it defines. When people keep asking about something it doesn't define, such as the best customer, add a definition so the agent stops having to choose one.

### Who should own a metric definition?

The person who answers for the number: finance for revenue, the support lead for response times. The owner doesn't need to write code. Their job is to decide what the metric means and to approve every change to it. Someone else, a data engineer or an AI agent, can write the definition and check it against the data.

### How do we version control metric definitions in Git?

Keep the definitions in text files in a Git repository, like code. With open-source Malloy, a data model is a set of .malloy files, so each change is a commit reviewed in a pull request, with a history of who changed what and why. Run the eval in the same pull request, so a change that moves a verified answer shows up before it merges.

