Maximizing Accuracy in Microsoft Fabric: Best Practices for Data Agent Semantic Models

As organizations move toward conversational systems using generative AI, the ability to ask natural language questions of your data is becoming a game-changer. The Fabric data agent enables this by connecting Power BI semantic models as data sources, allowing users to receive accurate answers without writing complex SQL or DAX queries.

However, the “magic” of AI isn’t automatic. The quality of the responses you get depends heavily on how well you prepare your data sources. If you want your AI to distinguish between “Gross Sales” and “Net Sales” or understand what a “Top Performer” is, you need to optimize your semantic model specifically for the Fabric data agent.

Here is your guide to configuring your semantic models for maximum accuracy and relevance.

How the Data Agent “Thinks”

Before diving into configuration, it helps to understand the architecture. When a user asks a question, the data agent uses an Orchestrator to select the right data source. For semantic models, it invokes a DAX generation tool that creates, validates, and executes queries

Crucially, this DAX generation tool relies solely on the semantic model’s metadata and “Prep for AI” configurations. It explicitly ignores any instructions you add at the general data agent level regarding DAX generation. This makes the configurations inside the semantic model—specifically the “Prep for AI” features—essential for success

Three Pillars of “Prep for AI”

Power BI’s “Prep for AI” feature offers three components that directly control how the data agent interprets your model.

1. AI Data Schemas: Reducing the Noise

Large models often contain duplicate measures, helper columns, or technical fields that confuse an AI. An AI data schema allows you to define a focused subset of tables, columns, and measures for the AI to prioritize.

Why it matters: Reducing the scope reduces ambiguity and response latency.

Best Practice: Use clear, business-friendly names. Rename technical fields like TR_AMT or DIM_GEO_01 to Total Revenue or Sales Region. If you have overlapping measures (e.g., Total Sales, Sales Amount, Revenue), exclude the duplicates in the schema to prevent the AI from guessing

2. Verified Answers: Guiding Complex Queries

Verified answers are pre-defined, user-approved visual responses triggered by specific questions. When a user asks a question similar to a verified answer trigger, the system uses the properties of that visual (its columns, measures, and filters) to guide the DAX generation tool toward the correct query structure.

Example: If a user asks, “Show me performance by territory,” the AI might mistake “territory” for a product category. By creating a verified answer using a specific regional sales visual, you ensure the AI understands “territory” refers to sales regions.

Best Practice: Use five to seven trigger questions per answer to cover natural phrasing variations.

3. AI Instructions: Defining Business Logic

This is where you provide unstructured context. You can define terminology, metric preferences, and analysis logic directly on the semantic model.

The Golden Rule: Do not add semantic model-specific instructions at the agent level; they will be ignored. Keep all definitions (like what constitutes a “fiscal year” or a “loyal customer”) inside the semantic model’s Prep for AI instructions.

Example: “A top performer is a sales representative who achieves 110% or more of their monthly quota”

Implementation Workflow

To build a robust data agent, follow this optimized workflow:

1. Optimize the Model: Start with performance. A slow, bloated model leads to slow AI responses. Use a star schema and remove high-cardinality columns where possible,,.

2. Define AI Data Schema: Select only the relevant tables and measures in “Prep for AI”.

3. Create Verified Answers: Identify common questions and map them to trusted visuals.

4. Test and Iterate: Add the model to the data agent and test responses. Then add AI instructions based on where the agent fails.

5. Verify DAX: When testing, look at the generated DAX query to ensure it is valid. If it’s wrong, adjust your schema or instructions.

Common Pitfalls to Avoid

Not using Star Schema: Flat or pivoted tables make DAX generation inefficient and error-prone.

Ambiguous Date Fields: If you have Order Date, Ship Date, and Due Date, the AI needs guidance on which one to use by default.

Conflicting Instructions: Ensure your AI instructions don’t contradict your Verified Answers, as this causes unpredictable behavior.

Relying on Hidden Fields: Verified answers will fail if they reference columns that are hidden in the model

Conclusion

Building a conversational data system isn’t just about the AI model; it’s about the data architecture underneath it. By leveraging Prep for AI to refine schemas, define business logic, and verify answers, you turn your semantic model into a reliable source of truth for the Fabric data agent.

Leave a Reply

Discover more from BiMasters

Subscribe now to keep reading and get access to the full archive.

Continue reading