Projects · AI-Powered Analytics · Multifamily operations

Metric Definitions Agent

A Copilot Studio agent that reads the code behind our Power BI semantic model, so anyone can ask how a metric is calculated, what it depends on, and how to rebuild it in SQL.

Copilot StudioAI agentsSemantic modelPower BISnowflakeDAX

The setup

Our Residential Model is a semantic model with over 100 tables of governed, defined data in Snowflake. That data feeds a Power BI report, and the semantic layer gets published from there.

On top of that, many metrics are defined as DAX measures inside Power BI: calculations that make more sense native to Power BI than in the database.

The problem

It’s a lot of data and a lot of definitions. It’s hard to know how each metric is calculated, which other metrics it’s built on, and how far back a DAX calculation looks.

A new, data-savvy employee could spend far too much time just learning how the calculations work before doing anything useful with them.

What I built

  1. Exported the model’s code. Power BI can save a semantic model as TMDL files (Tabular Model Definition Language): plain-text files that define every table, relationship, and measure.
  2. Put the files in a SharePoint folder.
  3. Built a Copilot Studio agent connected to that folder through the SharePoint MCP connector.
  4. Wrote detailed instructions for how the agent should navigate the files and what its answers should look like.

What it can do

Now anyone can just ask: “How is Initial Agent Net Conversion % calculated?”

The agent answers with:

  • The definition of the metric, in plain English and in DAX
  • The other metrics it’s built from, so you can trace the logic all the way down
  • The time window the calculation covers

It goes further than lookups, too:

  • Rebuilding metrics in SQL. When I needed to recreate a metric in Snowflake, I asked the agent to translate it, and it worked perfectly.
  • Building on existing metrics. When we wanted new metrics based on current ones, the agent could draft the YAML definition file, using the existing definitions as its starting point.

Why it matters

A semantic model is only as useful as people’s understanding of it. This agent turned a hundred tables of definitions into something you can ask in plain English. The data team spends less time answering “how is this calculated?”, and new teammates get up to speed much faster.