
Fabric Capacity
Automatically invoke this skill whenever the user asks why a Fabric capacity is busy...
Install
npx skills add data-goblin/power-bi-agentic-development --skill fabric-capacity -g -a claude-code -y- Repository
- data-goblin/power-bi-agentic-development1.1k
- Category
- Engineering
- Updated
- 5d ago
- License
- GPL-3.0
- Context cost
- Lightabout 1,392 tokens
- Runs scripts
- No, instructions only
What it does
Automatically invoke this skill whenever the user asks why a Fabric capacity is busy, throttled, at 90 or 100 percent, or what is consuming CUs; asks for current capacity utilization, carry forward or per-item CU usage; wants to query or repair the Microsoft Fabric Capacity Metrics app or its semantic model; or wants to start, pause or monitor a capacity from a script or status bar.
Fabric Capacity
Read capacity utilization and per-item CU from the Microsoft Fabric Capacity Metrics semantic model with fab, and start or pause a capacity. Invoke the fabric-cli skill alongside this one; its references/capacity-cost.md covers budget math, smoothing and throttling.
Where the numbers live
live (DirectQuery, CapacityMetricsCES connector):
CU Detail: per 30 s timepoint; Interactive, Background, CU limit, SKU
Timepoint CU Detail: same, per timepoint detail page
Metrics By Item [And Day|And Hour|And Operation]: CU (s), Duration (s), Operations, Users per item
System Events: pause, resume, state changes
import (fresh only after a model refresh; Pro workspace = 8 refreshes a day):
Capacities, Items, Workspaces, Timepoints/Dates calendars
Average utilization (last 1 hour | last 24 hours | last 7 days): measures on the Health page
not available: Azure Monitor has no metrics namespace for Microsoft.Fabric/capacities
Anything that must be current (a status bar, "what is using the capacity now") needs the DirectQuery tables.
Query with fab
The model sits in a Pro workspace, so there is no XMLA endpoint and te cannot connect. Use executeQueries through fab. DirectQuery tables need the capacity passed as an M parameter inside a DEFINE block; without it the connector fails, and the error reads like a credential problem.
fab api -A powerbi "groups/<metrics-ws-id>/datasets/<metrics-model-id>/executeQueries" -X post -i "$(jq -cn --arg q "$(cat <<'EOF'
DEFINE
MPARAMETER 'CapacitiesList' = {"<CAPACITY-ID-UPPERCASE>"}
VAR point = MINX(TOPN(2, 'CU Detail', 'CU Detail'[Window start time], DESC), 'CU Detail'[Window start time])
EVALUATE
ROW("pct", CALCULATE(
DIVIDE(SUM('CU Detail'[Interactive]) + SUM('CU Detail'[Background]), MAX('CU Detail'[Base capacity units]) * 30),
'CU Detail'[Window start time] = point) * 100)
EOF
)" '{queries: [{query: $q}]}')"
