What if your sales team could ask "What was our pipeline coverage ratio last quarter by region?" and get an instant, accurate answer — without opening Power BI, without knowing DAX, without filing a request with the BI team?
That is what Fabric Data Agents do. They are conversational AI systems that sit on top of your Fabric data and answer natural language questions with structured, accurate results. No coding required to build one. No AI expertise needed to use one.
This tutorial walks through building a Data Agent from scratch. By the end, you will have a working agent that your team can use in Teams, M365 Copilot, or directly in Fabric.
Prerequisites
Before you start, you need:
- Fabric capacity — F2 or higher (or any P edition). Free trials do not support Data Agents.
- A semantic model — a Power BI dataset with your business data. The model should have clear table names, column names, and relationships.
- Pro or PPU licence — to create and publish the agent.
- Workspace access — a Fabric workspace on your capacity where you can create artifacts.
If you do not have a semantic model ready, you can use any existing Power BI dataset. The agent works with whatever data is already in your model.
Step 1: Create the Data Agent (5 minutes)
- Open your Fabric workspace at app.fabric.microsoft.com
- Click + New → Data Agent
- Name your agent (e.g., "Sales Analytics Agent")
- Add a description: "Answers questions about sales data, pipeline, revenue, and customer metrics"
- Click Create
You now have an empty Data Agent. The interface has three panels:
- Left panel: Data sources and configuration
- Centre panel: Test chat for trying queries
- Right panel: Settings and custom instructions
Step 2: Connect Data Sources (5 minutes)
- In the left panel, click + Add data source
- Select Semantic model
- Choose your Power BI dataset from the workspace
- Click Connect
The agent imports the model's metadata — table names, column names, relationships, measures, and hierarchies. This takes a few seconds.
What gets imported:
- Table and column names (used for NL2DAX translation)
- Relationships between tables (used for query generation)
- Measures and calculated columns (used as reference)
- Hierarchies (used for drill-down queries)
What does not get imported:
- Row-level security rules (these are enforced at query time)
- Actual data values (the agent does not store your data)
You can add up to 5 data sources in any combination: semantic models, lakehouses, warehouses, and KQL databases. For this tutorial, one semantic model is enough.
Step 3: Write Custom Instructions (10 minutes)
Custom instructions are the most important part of your Data Agent. They tell the agent how to behave, what terminology to use, and what guardrails to follow.
Click the Instructions tab in the right panel and write the following:
You are a sales analytics assistant for Contoso Ltd. You answer questions about sales data, pipeline, revenue, and customer metrics.
Data conventions:
- Revenue is in the "Sales" table, column "Revenue"
- Fiscal year starts July 1 (FY2025 = July 2024 to June 2025)
- "Pipeline" refers to the "Opportunities" table
- "Win rate" = Closed Won / Total Opportunities
- "ARR" = Annual Recurring Revenue from the "Subscriptions" table
Response format:
- Always include the actual numbers, not just trends
- Use currency formatting with 2 decimal places
- Include the time period in your response
- If a question is ambiguous, ask for clarification
Guardrails:
- Only answer questions about sales, pipeline, revenue, and customers
- Do not speculate or make predictions unless asked
- If you cannot find the data, say so clearly
- Do not reveal sensitive data like individual salaries or commissions
Tips for good instructions:
- Be specific about terminology (what does "pipeline" mean in your organisation?)
- Define calculations (how is "win rate" calculated?)
- Set response format expectations (currency, percentages, time periods)
- Add guardrails (what should the agent NOT do?)
Step 4: Add Example Queries (10 minutes)
Example queries dramatically improve accuracy. They teach the agent the pattern of questions your team asks and how to translate them into queries.
Click the Examples tab and add at least 5 examples:
Example 1:
- Question: "What was our total revenue last quarter?"
- Expected pattern: Sum of Revenue from Sales table, filtered by fiscal quarter
Example 2:
- Question: "Show me win rate by region for FY2025"
- Expected pattern: Calculated metric (Closed Won / Total) grouped by Region
Example 3:
- Question: "Which sales rep has the highest pipeline value?"
- Expected pattern: Top 1 from Opportunities table, grouped by Sales Rep
Example 4:
- Question: "Compare ARR this month vs last month"
- Expected pattern: Time-based comparison from Subscriptions table
Example 5:
- Question: "What are the top 10 customers by revenue?"
- Expected pattern: Top N query from Sales table, grouped by Customer
Why examples matter:
- They teach the agent your organisation's vocabulary
- They show the expected level of detail in responses
- They reduce hallucination by grounding the agent in real query patterns
- They improve NL2DAX accuracy for complex calculations
Step 5: Test and Iterate (15 minutes)
Now the important part — testing. Use the centre panel chat to ask questions and verify the agent's responses.
Start with simple questions:
- "What is our total revenue?" — verify the number matches your Power BI report
- "How many opportunities are in the pipeline?" — verify against your dataset
- "What is our win rate?" — verify the calculation matches your definition
Then try more complex questions:
- "Show me revenue by region for the last 3 months" — verify grouping and filtering
- "Which product category has the highest growth rate?" — verify the agent understands "growth"
- "Compare Q1 vs Q2 performance" — verify time period handling
Common issues and fixes:
| Issue | Cause | Fix |
|---|---|---|
| Wrong numbers | Ambiguous column names | Add more specific instructions about which table/column to use |
| "I don't know" response | Missing terminology | Add the term to custom instructions with its definition |
| Incorrect calculation | Ambiguous metric definition | Define the exact formula in instructions |
| Too verbose | No response format guidance | Add response format instructions |
| Answers outside scope | No guardrails | Add guardrails to instructions |
Iterate: For every wrong answer, update your instructions or examples. The agent learns from your configuration — the better your instructions, the better its answers.
Step 6: Publish and Distribute (10 minutes)
Once you are happy with the test results, publish the agent:
- Click Publish in the top-right corner
- The agent is now available in your Fabric workspace
- To share with your team, click Share and add users or groups
Publish to M365 Copilot:
- In the agent settings, navigate to Integrations
- Click Microsoft 365 Copilot
- Follow the prompts to register the agent in Copilot Studio
- Your team can now access the agent from the Copilot pane in Teams, Outlook, and other M365 apps
Publish to Teams:
- In Copilot Studio, create a Teams channel for the agent
- Configure the agent to appear in a specific Teams channel or as a personal app
- Team members can @mention the agent and ask questions directly in Teams
Governance with Purview:
- Navigate to Microsoft Purview
- Configure DLP policies for your Data Agent
- Set access restrictions (who can use the agent, what data they can access)
- Enable auditing for compliance
Step 7: ALM and Git Integration (5 minutes)
For production use, integrate your Data Agent with Git for version control and deployment pipelines:
- In your Fabric workspace, click Workspace settings → Git integration
- Connect to your Azure DevOps repository
- The Data Agent configuration (instructions, examples, data sources) is committed to Git
- Use deployment pipelines to promote the agent from Dev → Test → Production
This ensures your agent configuration is versioned, auditable, and deployable across environments.
Summary
You have built a Data Agent that:
- Answers natural language questions about your sales data
- Translates questions to DAX queries automatically
- Respects your existing security model
- Works in Fabric, M365 Copilot, and Teams
- Is version-controlled and deployable via Git
Total time: approximately 50 minutes.
The agent will improve as you add more examples and refine your instructions. Treat it like a new team member — it needs onboarding, feedback, and guidance to perform at its best.
Your team can now talk to their data. No DAX required.