Why AI gets numbers wrong (and how to fix it)

A customer asks an AI assistant how much revenue their company generated last month. The assistant returns a confident answer. Their dashboard shows a different amount. Both interfaces use the same underlying database, so which number should they trust?
The problem may have very little to do with arithmetic. One interface might count booked contracts while the other counts paid invoices. A join may have duplicated transactions or a date filter may use the wrong timezone. A perfectly fluent explanation can conceal any of these errors.
Software teams adding AI analytics to their products need to diagnose where an incorrect number came from. Treat the path from question to answer as a data pipeline with observable stages, and you can fix problems without endlessly rewriting prompts.
Why does AI get numbers wrong?
AI can return incorrect numbers when it misunderstands a question, chooses the wrong metric, queries an inappropriate data scope, performs incorrect calculations or generates text unsupported by the query result. Reliable analytical systems reduce these risks through governed definitions, deterministic calculations, permission checks and verification against known results.
A language model can describe a calculation convincingly without executing it correctly. Connecting it to analytical tools makes real computation possible, but it does not guarantee that the chosen computation matches the customer's intent.
Follow the number through the analytical pipeline
Start with the original question. Record the interpreted intent, metric identifier, time range, filters, permission scope and tool invocation. Compare the raw query result with the value in the generated response. Each boundary gives you a different place to investigate.
If the tool returned 125 and the answer said 152, you have a presentation error. If the tool returned 152 but the correct query returns 125, examine the query and data model. If both queries are valid under different definitions, investigate ambiguity rather than treating the database as broken.
1. The AI chooses a plausible but incorrect metric
Revenue might refer to net recognized revenue, gross invoiced revenue, recurring revenue or payments collected. A column called revenue does not settle the question.
A SaaS customer asking about sales performance may expect bookings, while the finance team expects recognized revenue. If the product defaults to a single interpretation without explaining it, both audiences can receive a technically valid but contextually incorrect result.
Create a registry of metrics with identifiers, formulas, units, inclusion rules and ownership. Provide descriptions for common business language. When multiple definitions remain plausible, ask for clarification or display the definition applied.
Luzmo's discussion of the semantic layer for AI analytics explores how shared definitions support consistent answers across interfaces. The diagnostic step here is to verify which definition the agent selected for a particular request.
2. A join duplicates rows
Suppose an order worth $100 contains three line items. Joining the orders table to the line-items table produces three rows. Summing the order total after the join yields $300 instead of $100.
Adding more explanatory text to the agent's prompt cannot reliably fix a data model that encourages invalid aggregation. Define the grain of each dataset and its relationships. Use approved measures that aggregate at the correct grain. Test cases involving one-to-many relationships, repeated keys and missing relationships.
A useful fixture contains two orders worth $100 and $200, with three and two line items respectively. The expected order-level total is $300. A careless join returns $700. A regression test should detect that difference even when the generated answer sounds reasonable.
3. The time window is different from what the customer intended
Last month can mean a calendar month in the customer's timezone, the previous 30 days or the most recently closed accounting period. Those ranges are not interchangeable.
A customer looking at January results on February 1 may still have transactions arriving from a timezone several hours behind. An AI agent that applies a UTC month boundary while a dashboard uses a local accounting calendar can report different numbers.
Specify the date field, timezone, start boundary and end boundary in the analytical request. Display them when relevant. Use a closed-open interval for timestamp filtering where the data model supports it, and test requests around daylight-saving changes, month ends and leap years.
4. Filters or permissions are missing
A company-wide total can differ from a regional manager's view because the manager is only authorized to see their own region. In multi-tenant SaaS, the consequences are more serious. An incorrect tenant filter can expose another organization's records.
Authorization belongs in a trusted execution layer. Never rely on the model to remember a tenant restriction from its instructions. The analytical service needs to check identity and permitted scope when a tool is invoked. The returned data must remain within that scope even when the user attempts to override the restriction.
An answer that is numerically accurate but unauthorized is a security failure. Our guide to AI analytics governance covers the broader access-control design.
5. The calculation uses the wrong denominator
Percentage changes often expose differences between apparently similar metrics. A change from 20% to 25% is five percentage points or a 25% relative increase. Describing it simply as a five percent increase is misleading.
Other common mistakes include averaging account-level conversion rates instead of computing a weighted rate, dividing by a count that includes inactive users and treating missing values as zero.
Move repeated business calculations into tested metric definitions. Keep the numerator and denominator visible during evaluation. For a division by zero, the correct outcome may be unavailable rather than a percentage. Avoid filling in a convenient number simply to make a chart look complete.
6. Data freshness creates an apparent contradiction
A morning dashboard may display a snapshot captured at 6 a.m. An agent querying a live database at noon can return a different value without either interface being wrong. The difference becomes confusing when neither shows its data timestamp.
Expose the effective freshness of the query where it is available. Distinguish the time the user asks the question from the time the underlying data was updated. When joining several datasets, determine whether their refresh schedules create a partially updated result.
If the customer is comparing an agent response with a dashboard, use the same snapshot or clearly explain why the results differ. Embedded analytics performance provides background on the execution path and caching decisions that influence this behavior.
7. The response changes the correct tool result
A calculation may succeed and still be misrepresented. A model might round a decimal incorrectly, drop a negative sign or introduce a number while summarizing a trend.
Where possible, render critical values directly from structured query results and use generated text to explain their context. The narrative should refer to known fields rather than inventing a new calculation. Compare numerical claims in the final response with the evidence returned by tools.
This is especially important with charts. Check the series, filters, units and axis labels before treating the chart as a trustworthy representation of the data. A correct text summary cannot compensate for an incorrectly configured visualization.
A practical incident investigation
Imagine an operations dashboard reports 1,200 completed deliveries for the month, while the AI assistant reports 1,380. The data team first captures both requests and freezes the dataset snapshot. It then discovers that the agent used the shipment creation date while the dashboard filtered by completion date.
The difference reflects a definition mismatch, not a model arithmetic failure. The team updates its metric registry to specify the completion date, adds a fixture containing shipments created in one month and delivered in another, then retests the original question and related phrasings.
The next regression run should cover both the count and its interpretation. A question about shipments created during the month must still return the creation-based number. Fixing one metric by forcing every question through the completion date would introduce a new error.
How to verify an AI-generated number before relying on it
Use an independently calculated reference value. A second response from the same model is not independent verification. Create a known query or use a reviewed dashboard metric with matching filters and freshness. Compare the raw value before rounding. For currencies, preserve the relevant unit and precision.
If a difference appears, classify the failure as intent resolution, authorization, data quality, query logic, arithmetic or presentation. Assign it to the team that controls that layer. This makes incident response faster and reveals recurring weaknesses across different questions.
For sensitive decisions, provide a way to inspect the underlying report or source. Customers should be able to distinguish a verified analytical result from an exploratory hypothesis about its cause.
How to design an answer that customers can verify
A reliable answer needs enough context for a customer to recognize what was calculated. A revenue figure accompanied by its currency, reporting period and definition is far easier to verify than a number presented alone. The interface can show the applied filters and provide a route back to a report with the same scope.
Keep the level of explanation proportionate to the task. A familiar KPI might need only a short label and timestamp. An unfamiliar analytical breakdown may warrant a summary of the calculation, a chart and an explanation of any missing records. Customers should not have to read implementation details to understand a routine answer.
Avoid promising certainty when the data is incomplete. If a customer asks why a metric declined, the agent may be able to identify which segments contributed to the decline. That is different from proving why customer behavior changed. Separate observed changes from causal hypotheses and make that distinction visible in the response.
What to do when two correct answers disagree
Establish a reconciliation workflow rather than asking the customer to choose between interfaces. First capture the scope of both calculations. Then compare their metric definitions, dataset snapshots and user permissions. If the difference is intentional, improve the labels and explain the purpose of each metric. If it is accidental, fix the relevant definition or execution path.
A SaaS product can keep booked revenue and collected revenue as separate measures with clear descriptions. It should not quietly rename one of them as revenue simply because it produces a number the customer expects. A disagreement is an opportunity to make the analytical contract more precise.
Add the reconciled case to a regression suite. Include at least one question that explicitly requests each definition and one ambiguous version that should trigger clarification. Our guide to testing AI analytics agents outlines how to maintain those fixtures as the product evolves.
A numerical accuracy checklist
- The metric definition matches the requested business concept.
- The relevant tenant and role are authorized by the execution service.
- Date boundaries, timezone and filters match the intended period.
- Joins preserve the required level of aggregation.
- Nulls, currencies, weights and denominators follow approved rules.
- The query result can be reproduced from the same snapshot.
- Displayed numbers and charts match the structured result.
- Uncertainty is visible when the data cannot support an answer.
Build reliability into the analytics layer
A more capable model may improve language understanding, but it cannot resolve a business definition that nobody has agreed on. Nor can it replace permission enforcement or repair a flawed data model.
Luzmo's embedded AI analytics combines analytical context with agents that can work within a product's data environment. Evaluate that architecture with your own metrics and known answers. Accuracy must be established for the actual customer workload rather than inferred from a feature description.
Start with the numbers your customers use to make decisions every day. If the agent can explain how those numbers were defined, retrieve them within the right scope and present them without distortion, you have a foundation for expanding into more complex analytical questions.
Written by

Popular articles

Why AI Makes the Semantic Layer More Important, Not Less
AI makes analytics easier to access, but harder to keep consistent. Learn why a governed semantic layer matters for accurate AI analytics across apps and agents.

AI Analytics Governance: How to Control What AI Agents Can Access and Answer
Learn how to govern customer-facing AI analytics with identity controls, tenant isolation, approved metrics, response review and practical deployment tests.

How to test AI analytics agents before shipping them to customers
Build a repeatable evaluation suite for customer-facing AI analytics agents, with numerical accuracy tests, tenant isolation checks and release criteria.
Ship the future of your data
Let us show you what Luzmo can do for your product.

Book your session with our analytics expert.