/devils-analyst:power-bi-definitionsfrom devils-analyst
Reads Power BI semantic model definitions (DAX measures, formats, relationships, warehouse sources) from PBIP, TMDL, or .pbix files and translates them to SQL so Claude dashboards match Power BI numbers exactly.
Ships in devils-analyst. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Most companies that point Claude at Snowflake or Databricks already have a Power BI model on the same tables, and that model already says what CAC, ROAS and "active customer" mean. A dashboard that re-invents those definitions disagrees with the report everyone else reads. This skill makes the dashboard use the model's definitions, so the two show the same number.
Pick the first route that works:
| The user has | Do this |
|---|---|
| A PBIP folder on disk (Claude Code) | python3 scripts/metric_contract.py <folder> --format markdown (path relative to this skill's folder; in Claude Code use ${CLAUDE_SKILL_DIR}/scripts/metric_contract.py) |
A zip of the *.SemanticModel folder (claude.ai with code execution) | Unzip it in the sandbox, then run the same script on it |
A .pbix only | Ask them to open it in Power BI Desktop and File > Save as > Power BI Project (PBIP) with the TMDL format, then zip the .SemanticModel folder |
| Pasted TMDL, or a list of measures and their DAX | Read it directly and build the same table by hand |
The script is read-only and uses only the Python standard library. Its output has four parts: measures (name, format, description, DAX), tables and visible columns, warehouse sources (connector, database.schema.table or native SQL behind each table, plus columns renamed from the source), and relationships.
Suggest saving the result as metric-dictionary.md in a Claude Project, so every
later dashboard in that Project starts from it.
Before building, show the measures the request needs, and flag:
DIVIDE of two base measures;Use the warehouse sources section. Then check three things with the user, or in the data:
If the user has added a Power BI MCP server as a connector (Microsoft's Power BI MCP server, which can run DAX queries against a semantic model), a Claude Dashboard dataset can query the model directly, so the dashboard uses the model's own measures, with each viewer's own permissions:
EVALUATE
SUMMARIZECOLUMNS (
'Calendar'[Year-Month],
Channels[channel_group],
"Spend", [Total Ad Spend],
"New customers", [New Customers #],
"CAC", [CAC]
)
Reference measures by name; never re-implement them in the DAX query. The
connector usually needs the semantic model's ID (not its name) and a tenant
setting enabled by a Fabric admin; ask the user for both. Shape the answer into
rows with a loader, and return the DAX that ran as meta so readers can see it
in Sources. Only if no such connector exists, translate to warehouse SQL:
Follow references/dax-to-sql.md. The rules that
break most translations: CALCULATE filters replace a slicer on the same
column, ratios are computed from summed parts at the displayed grain, two fact
tables are aggregated separately before they are joined, and BLANK is not zero.
If a measure cannot be translated faithfully (calculation groups, complex context transition, many-to-many with bidirectional filters), say so, and leave it out or show it labelled "Power BI only". Never ship a near-miss under the real name.
In the dashboard's definitions panel, show each metric's DAX next to the SQL that implements it.
Ask for one number the user can see in their Power BI report (a KPI card, a total), with its filters. Compute the same in SQL. If it differs, check in this order: report or page filters, Power Query row filters, refresh timing, time zone of the date column, RLS, and the translation itself. Report the match, or the difference and its cause, at the top of the dashboard.
Hand over to the marketing-dashboard skill with the translated metrics as the
definitions. Power BI stays the source of truth: if the user wants a metric the
model lacks, propose the DAX (name, format, description) so it can be added to
the model, rather than defining it only in the dashboard.
Before you reuse a measure, run it past
references/power-bi-audit.md: averaged rates,
summed snapshots, toggle defaults, stacked platform revenue, duplicate KPIs.
Compare each measure with the formula, source and grain the
metric-definitions skill gives for that metric (and with any house rule
that overrides it), not with the measure's name. A wrong measure reused
faithfully is still wrong: flag it, propose the corrected DAX, and let the
model owner decide.
If the user also maintains the model as PBIP in git, the companion command-line
tools (model linting, building sample models from a spec, keeping client copies
in sync, styling report charts) are described in
references/power-bi-tools.md. They need a local
shell and uv; they do not run in claude.ai.
Every move above has a challenger. Run the attack, settle it with the check, and act on a failure before moving on.
| Move | Adversary asks | Check that settles it | If it fails |
|---|---|---|---|
| Read the model | "Which toggle or selector silently changes this measure?" | every disconnected table and its fallback value listed | pin it explicitly in the query |
| Map measures | "Is this measure really the catalog metric it is named after?" | DAX compared with the metric-definitions formula | classify as defensible or wrong |
| Audit the DAX | "Would this measure be right at every grain (averaged rates, summed snapshots, unfiltered report levels)?" | evaluate at two grains; compare with a DIVIDE of sums | propose corrected DAX |
| Translate to SQL | "Does the SQL reproduce one number the user can see in Power BI?" | reconcile one KPI | find the cause in the order given |
| Write to the model | "Has the user approved this change, on a write-capable connector?" | explicit approval | propose only |
Score and probe before handing over. First the gate: every check in the table above passed; if one did not, fix it before scoring. Then score the draft 0-100 on four dimensions: clarity (unambiguous, easy to follow), relevance (answers the question asked, for this reader), depth (explains the why with numbers, not only the what) and insightfulness (says something the reader did not already know, and what to do about it). If any score is below 80, write the probe question that would raise it, answer it from the data, revise, and score again (two loops at most). The question and the decision belong to the person asking: when either is unclear, ask instead of assuming.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/auditUse this skill when someone wants a whole marketing setup or account checked, not one report: "audit our Google Ads account", "audit my GA4 setup", "audit our tracking", "health check our email program", "what's broken in our setup", "where are we wasting money", "we just took over this account, what should we fix first", "is our Meta / Performance Max set up right", "check our UTMs", "audit our Search Console", "audit our CRM or lifecycle program", "check our Power BI model", "review this TMDL / semantic model", or an account, settings or model export with "what's wrong with it". It maps the setup, runs the checks for each area present (paid search, Performance Max, Meta, GA4 and UTMs, Search Console, email, CRM, revenue, experiments, attribution, dashboards, Power BI), estimates the money at stake, ranks findings Must fix, Should fix, Nice to have and ends "Fix N first". One report or deck: use review. Whether a single channel pays: use channel-audit./brand-healthUse this skill when the question is about the brand rather than one campaign: "is our brand getting stronger or weaker", "is our brand healthy", awareness, consideration or preference from a tracker or survey, brand search volume, direct traffic as a brand signal, share of voice or share of search, social mentions and sentiment, "are promotions hurting the brand", baseline sales, price premium or "can we raise prices", "should we cut brand ads and put it into performance", a flat brand score, NPS up but repeat purchase down, "should we launch [product] under our brand", line or category extension, sub-brand, repositioning, rebrand, "milk or kill this brand", brand valuation, and whether content is on-brand. It measures brand health from the data, separates short-term sales from long-term equity, checks per segment, and turns the result into a decision with a way to verify it.npx claudepluginhub c-kapsalis/devils-analyst --plugin devils-analystOther plugins' skills for the same job