Skip to main content

Just published: The Hopmann AI Foundation – the structured path to Agentic Marketing Intelligence. Read now. >

Semantic Models via MCP as a Basis for AI Analysis

Power BI + Claude


HMA Team Tobias Lanzl scaled 857e12d2
Tobias Lanzl on July 15, 2026

Technical Deep Dive on “Power BI + Claude” for BI managers and data analysts

TL;DR The Model Context Protocol (MCP) allows Claude Desktop to connect directly to Power BI Service. Claude reads the semantic model, writes DAX queries based on defined measures and returns results that match the existing dashboards. The setup works with a Power BI Pro licence, no Premium or Fabric capacity required. The decisive quality boost comes from an additional context layer in the form of a YAML file containing business context.

Dashboards answer the questions they were built for. The interesting follow-up questions come after: “Why did revenue drop in Germany in November?” “What does that look like without the campaign?” “Can you put that into a slide for the board?” Until now that meant: a ticket to the BI team and waiting for new reports.

The Model Context Protocol closes this gap. We connected Claude Desktop directly to Power BI Service. Claude independently writes DAX queries against the semantic model, uses the measures defined there and delivers results straight into PowerPoint slides or formatted PDFs.

In this article we walk through the technical setup and explain why an additional context layer in the form of YAML files makes the difference between a “nice experiment” and a “reliable analysis tool”.

Architecture overview

The setup consists of three components:

  1. A local MCP server, a single Python script that connects Power BI Service via the REST API and gives Claude four tools: list workspaces, list semantic models, describe model structure and run DAX queries.
  2. Delegated authentication via Microsoft Entra (Device Code Flow). You sign in once with your own account, a refresh token is cached locally. Claude acts under the identity of the signed-in user. Row-level security applies automatically and no client secrets are stored.
  3. One context layer per semantic model: a YAML file with business context that Claude reads before every analysis.
Architecture diagram: Claude Desktop connects via MCP server to Power BI Service and YAML context layer and returns an answer
The setup at a glance: Claude Desktop accesses Power BI Service and the YAML context layer via the MCP server.

How a query works: the user asks a question in natural language. Claude reads the model context, writes a DAX query, runs it against the live model via the MCP server and interprets the result, including follow-up questions and further analysis in the same chat.

Why the setup works without Fabric

The usual way to access semantic models programmatically is via the XMLA endpoint, which requires Premium, PPU or Fabric capacity. Our setup uses the executeQueries REST endpoint instead, which is available on Shared Capacity. All that is needed on the user side is a Power BI Pro licence and Build permission on the relevant semantic model.

Access is deliberately read-only: the Entra app requests only Read scopes (Workspace.Read.All, Dataset.Read.All). Nothing in the model can be changed via this route, which is an important point for governance. Claude consumes the model like a report user, not like a developer.

The technical limits of executeQueries (one query per call, around 100,000 rows per result, roughly 120 requests per minute) are not a bottleneck for interactive analysis in practice.

The real advantage of Power BI + Claude: the semantic model as a single source of truth

A common concern about “AI on data” is that every tool calculates metrics differently. This setup gets around that problem because Claude does not work on raw data but on the semantic model, the same layer that feeds the Power BI reports.

A Revenue measure is defined there once, including all the nuances such as discount logic, time intelligence and filter context. When Claude references [Revenue] in its query instead of inventing its own SUM(), it is guaranteed that the number in the chat is the same as in the dashboard. The descriptions of tables, columns and measures that the model author has maintained also come through via the model query. Documentation work in the model therefore pays off twice.

This is the difference from a classic text-to-SQL approach: Claude answers deeper questions on the basis of already defined and agreed metrics rather than recalculating them on the fly.

Power BI data panel showing the Revenue measure and its description: Total sales revenue, calculated as the sum of fact_orders[revenue] (quantity x unit price) for the selected orders
The semantic model as a single source of truth: the Revenue measure is defined once and referenced directly by Claude.

The context layer: what the model does not know

However well a semantic model is maintained, it knows nothing about the business context around it. Why is there a data gap in November? What happened in February when a single product suddenly took off? That kind of knowledge usually lives in the heads of analysts.

A language model does not bring that knowledge with it. And because it answers anyway when in doubt, the result without this knowledge is the most dangerous kind: a plausible-sounding, neatly formatted, incorrect analysis.

We have externalised this knowledge into a YAML file per semantic model, stored in the Claude Project. The file typically contains a description and domain of the dataset, an event timeline with business-relevant events such as campaigns, IT outages or manual corrections, sample questions with ready-made DAX queries as templates, and known pitfalls.

What the Semantic Layer does technically and how it differs from the context layer is covered in the second part of this series.

An excerpt from our demo setup with the Northwind dataset:

dataset:
  name: Northwind Sales
  domain: B2B wholesale of specialty food products
  time_grain: One row per order line item

event_timeline:
  - 2024-10-30: Service token for the Order API in Germany expired,
      re-authentication not until 2024-12-03.
  - February 2025: Revenue spike for Côte de Blaye in Germany
      due to marketing campaign.
  - March 2025: Supply chain issues for beverages in Germany

known_caveats:
  - "Revenue is quantity x unit price without discount and freight,
     do not describe as net revenue or gross profit."

The effect in practice: when asked about the revenue drop in Germany in March 2025, Claude does not run through wild hypotheses but recognises from the timeline that a revenue spike for one product in February and a supply problem for beverages in March together explain the decline, and points this out rather than hallucinating an explanation. This is exactly what separates a useful analysis from a misleading one.

Claude analyses the revenue trend for Germany in 2025 with a peak in February and a drop in March
Claude analyses the revenue trend for Germany in 2025 and identifies the February peak driven by the Côte de Blaye campaign.
Follow-up analysis: category breakdown shows the March drop is almost entirely driven by the beverages category
The follow-up analysis shows the March drop is almost entirely driven by the beverages category, explained by the supply chain issue in the event timeline.

Adding new models is deliberately lightweight: create a new YAML file in the project, enter the dataset_id, write the context, and the setup is ready. No installation, no restart.

From result to deliverable: integration in Claude Desktop and Cowork

The second major advantage over isolated “chat with your data” tools: the analysis does not end in the chat window. Because the setup runs in Claude Desktop or Claude Cowork, all further capabilities are immediately available. From the query results, a PowerPoint presentation with the key figures for management, a formatted PDF report for stakeholders, or a deeper analysis with visualisations can be produced in the same working step.

Limitations of the setup

For completeness: Q&A synonyms and the “Prep data for AI” configuration of a model sit in its linguistic layer, which is only accessible via XMLA and therefore requires Premium or Fabric. In practice the context layer in the form of the YAML file fulfils exactly this role, with the advantage of being versionable, human-readable and maintainable without additional capacity. Changes take effect immediately, with no deployment or model refresh.

Conclusion

The combination of semantic model and context layer turns Claude into an analysis tool that works with the same metrics as the existing reports while answering questions no dashboard was built for. The barrier to entry is low: an Entra app registration, a Python script, a Pro licence. The biggest difference in the end is not the technology but how well the business context is maintained.

At Hopmann Marketing Analytics we help BI teams and marketing organisations build this setup: from the technical integration and MCP configuration to building structured context layers for existing semantic models, making AI-powered analyses truly reliable. Would you like to know what a setup like this could look like for your Power BI models?

Book a free initial consultation

What our customers often want to know.

FAQ: Claude + Power BI via MCP

What is the Model Context Protocol (MCP) and how does it work with Power BI?

MCP is an open protocol that allows AI models like Claude to communicate directly with external tools and data sources. A local MCP server mediates between Claude Desktop and the Power BI REST API. Claude can list workspaces, describe semantic models and run DAX queries against live models, without data being exported to an external system.

Do I need Fabric or a Premium licence for this setup?

No. The setup uses the executeQueries REST endpoint, which is available on Shared Capacity. A Power BI Pro licence and Build permission on the relevant semantic model is all that is needed. Premium or Fabric capacity is not required.

How does this approach differ from text-to-SQL?

With text-to-SQL the AI generates SQL queries directly on raw data and invents its own calculation logic. Our approach uses the existing semantic model with its already defined and agreed measures. Claude references [Revenue] rather than constructing its own SUM(). This guarantees that the number in the chat is identical to the one in the dashboard.

What is the YAML context layer and why does it matter?

The semantic model knows what the data means and how it is calculated. The context layer adds why the data looks the way it does in a given period: expired API tokens, campaign launches, supply issues, known interpretation pitfalls. Without this context the AI answers plausibly but possibly incorrectly. The YAML context layer requires no deployment and can be updated at any time.

How secure is the integration from a data protection and governance perspective?

The Entra app requests only Read scopes (Workspace.Read.All, Dataset.Read.All). Claude acts under the identity of the signed-in user, row-level security of the Power BI model applies automatically. Nothing in the model can be changed via this route. No client secrets are stored and access is read-only throughout.

Does Hopmann Marketing Analytics offer support with the implementation?

Yes. We support BI teams and marketing organisations through the complete setup: from Entra app registration and MCP server configuration to Power BI integration and building structured context layers for existing semantic models. Get in touch if you would like to know what this could look like for your Power BI environment.

Tobias Lanzl is Manager Data Analytics at Hopmann Marketing Analytics, a certified Power BI expert specialising in AI-powered analytics architectures at the intersection of semantic models, context layers and large language models. As a former research associate and university lecturer he brings the ability to make complex AI and data architectures accessible in a way that works in practice.