/refresh-semantic-model
Automatically invoke this skill whenever the user asks to refresh a semantic model or a dataset. Can also be used to manage, optimize, troubleshoot, or configure a refresh or a refresh schedule.
$ npx -y skills add data-goblin/power-bi-agentic-development --skill refresh-semantic-model --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/refresh-semantic-model
Context preview
The summary Claude sees to decide when to auto-load this skill.
Automatically invoke this skill whenever the user asks to refresh a semantic model or a dataset. Can also be used to manage, optimize, troubleshoot, or configure a refresh or a refresh schedule.
SKILL.md
refresh-semantic-model.SKILL.mdname: refresh-semantic-model
description: Automatically invoke this skill whenever the user asks to refresh a semantic model or a dataset. Can also be used to manage, optimize, troubleshoot, or configure a refresh or a refresh schedule.
Refreshing Semantic Models
Trigger, monitor, validate, and troubleshoot semantic model refreshes via the Power BI Enhanced Refresh REST API and Fabric CLI.
Core Concepts
A semantic model refresh reloads data from upstream sources and/or recalculates dependent objects (calculated columns, calculated tables, measures). The scope can be the entire model, specific tables, or individual partitions.
Six refresh types are available via the REST API; a seventh (`add`) is TMSL-only:
| Type | Reloads Data | Recalculates | Primary Use Case | API | |---------------|:------------:|:------------:|--------------------------------------|:----:| | `full` | Yes | Yes | Complete reload from scratch | REST | | `automatic` | Conditional | Conditional | Smart refresh; process only if needed| REST | | `dataOnly` | Yes | No* | Reload data; clear dependents | REST | | `calculate` | No | Yes | Recalculate without reloading data | REST | | `clearValues` | No | No | Empty data from objects | REST | | `defragment` | No | No | Clean up column dictionaries | REST | | `add` | Append | Yes | Append rows to a partition | TMSL |
*`dataOnly` clears dependent objects (calculated columns, calculated tables) but does not recalculate them. Follow with a `calculate` refresh to restore them.
For detailed descriptions, behavior with incremental refresh policies, commit modes, and parallelism options, consult **`references/refresh-types.md`**.
Refresh Workflow
Step 1: Resolve IDs
Extract the workspace and model GUIDs needed for API calls:
WS_ID=$(fab get "WorkspaceName.Workspace" -q "id" | tr -d '"')
MODEL_ID=$(fab get "WorkspaceName.Workspace/ModelName.SemanticModel" -q "id" | tr -d '"')
Step 2: Query Baseline Data (Pre-Refresh Validation)
Before triggering the refresh, capture a baseline snapshot to later verify that data actually changed. Execute a DAX query against the model to get current row counts or max dates:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/executeQueries" \
-X post -i '{
"queries": [{"query": "EVALUATE ROW(\"RowCount\", COUNTROWS(FactSales), \"MaxDate\", MAX(FactSales[OrderDate]))"}],
"serializerSettings": {"includeNulls": true}
}'Record the output. This baseline is compared after refresh to confirm new data arrived.
Step 3: Trigger the Refresh
**Full model refresh (simplest):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"full"}'**Refresh specific tables:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{
"type": "full",
"objects": [{"table": "FactSales"}, {"table": "DimProduct"}]
}'**Refresh specific partitions:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{
"type": "full",
"objects": [
{"table": "FactSales", "partition": "FactSales_2024"},
{"table": "FactSales", "partition": "FactSales_2023"}
]
}'**Data-only refresh (skip recalculation):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"dataOnly","objects":[{"table":"FactSales"}]}'**Calculate only (no data reload):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"calculate"}'**Clear values from a table:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"clearValues","objects":[{"table":"StagingTable"}]}'For the script-based approach with CLI arguments, use **`scripts/refresh_model.py`**.
Step 4: Monitor Status
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1"
Status values: `Unknown`, `InProgress`, `Completed`, `Failed`, `Disabled`, `Cancelled`
Step 5: Post-Refresh Validation
After the refresh completes, re-run the same DAX query from Step 2 and compare:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/executeQueries" \
-X post -i '{
"queries": [{"query": "EVALUATE ROW(\"RowCount\", COUNTROWS(FactSales), \"MaxDate\", MAX(FactSales[OrderDate]))"}],
"serializerSettings": {"includeNulls": true}
}'**If data has not changed** after a successful refresh:
- The upstream data source has not been updated
- The ETL pipeline (Fabric pipeline, notebook, Data Factory, or other orchestration) needs to run first
- Check the lakehouse/warehouse/SQL database to verify fresh data exists
- For Fabric lakehouses: run `fab run "Workspace.Workspace/Pipeline.DataPipeline"` or trigger the notebook
- The refresh only pulls what the source provides; if the source is stale, the refresh will succeed but show no new data
Step 6: Cancel (if needed)
To cancel an in-progress enhanced refresh, first retrieve the `requestId` from the refresh history:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1"
The response includes a `requestId` field. Use it to cancel:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes/<requestId>" \
-X delete
Only works for refreshes triggered via the Enhanced API (not scheduled or portal refreshes).
Using the Refresh Script
The **`scripts/refresh_model.py`** script wraps the Enhanced Refresh API with CLI arguments:
# Full refresh
uv run scripts/refresh_model.py -w $WS_ID -m $MODEL_ID
# Refresh specific tables
uv run scripts/refresh_model.py -w $WS_ID -m $MODEL_ID --tables Sales,Calendar
# Refresh specific partitions
Read more
name: refresh-semantic-model description: Automatically invoke this skill whenever the user asks to refresh a semantic model or a dataset. Can also be used to manage, optimize, troubleshoot, or configure a refresh or a refresh schedule.
Refreshing Semantic Models
Trigger, monitor, validate, and troubleshoot semantic model refreshes via the Power BI Enhanced Refresh REST API and Fabric CLI.
Core Concepts
A semantic model refresh reloads data from upstream sources and/or recalculates dependent objects (calculated columns, calculated tables, measures). The scope can be the entire model, specific tables, or individual partitions.
Six refresh types are available via the REST API; a seventh (`add`) is TMSL-only:
| Type | Reloads Data | Recalculates | Primary Use Case | API | |---------------|:------------:|:------------:|--------------------------------------|:----:| | `full` | Yes | Yes | Complete reload from scratch | REST | | `automatic` | Conditional | Conditional | Smart refresh; process only if needed| REST | | `dataOnly` | Yes | No* | Reload data; clear dependents | REST | | `calculate` | No | Yes | Recalculate without reloading data | REST | | `clearValues` | No | No | Empty data from objects | REST | | `defragment` | No | No | Clean up column dictionaries | REST | | `add` | Append | Yes | Append rows to a partition | TMSL |
*`dataOnly` clears dependent objects (calculated columns, calculated tables) but does not recalculate them. Follow with a `calculate` refresh to restore them.
For detailed descriptions, behavior with incremental refresh policies, commit modes, and parallelism options, consult **`references/refresh-types.md`**.
Refresh Workflow
Step 1: Resolve IDs
Extract the workspace and model GUIDs needed for API calls:
WS_ID=$(fab get "WorkspaceName.Workspace" -q "id" | tr -d '"') MODEL_ID=$(fab get "WorkspaceName.Workspace/ModelName.SemanticModel" -q "id" | tr -d '"')
Step 2: Query Baseline Data (Pre-Refresh Validation)
Before triggering the refresh, capture a baseline snapshot to later verify that data actually changed. Execute a DAX query against the model to get current row counts or max dates:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/executeQueries" \
-X post -i '{
"queries": [{"query": "EVALUATE ROW(\"RowCount\", COUNTROWS(FactSales), \"MaxDate\", MAX(FactSales[OrderDate]))"}],
"serializerSettings": {"includeNulls": true}
}'Record the output. This baseline is compared after refresh to confirm new data arrived.
Step 3: Trigger the Refresh
**Full model refresh (simplest):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"full"}'**Refresh specific tables:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{
"type": "full",
"objects": [{"table": "FactSales"}, {"table": "DimProduct"}]
}'**Refresh specific partitions:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{
"type": "full",
"objects": [
{"table": "FactSales", "partition": "FactSales_2024"},
{"table": "FactSales", "partition": "FactSales_2023"}
]
}'**Data-only refresh (skip recalculation):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"dataOnly","objects":[{"table":"FactSales"}]}'**Calculate only (no data reload):**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"calculate"}'**Clear values from a table:**
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" \
-X post -i '{"type":"clearValues","objects":[{"table":"StagingTable"}]}'For the script-based approach with CLI arguments, use **`scripts/refresh_model.py`**.
Step 4: Monitor Status
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1"
Status values: `Unknown`, `InProgress`, `Completed`, `Failed`, `Disabled`, `Cancelled`
Step 5: Post-Refresh Validation
After the refresh completes, re-run the same DAX query from Step 2 and compare:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/executeQueries" \
-X post -i '{
"queries": [{"query": "EVALUATE ROW(\"RowCount\", COUNTROWS(FactSales), \"MaxDate\", MAX(FactSales[OrderDate]))"}],
"serializerSettings": {"includeNulls": true}
}'**If data has not changed** after a successful refresh:
- The upstream data source has not been updated
- The ETL pipeline (Fabric pipeline, notebook, Data Factory, or other orchestration) needs to run first
- Check the lakehouse/warehouse/SQL database to verify fresh data exists
- For Fabric lakehouses: run `fab run "Workspace.Workspace/Pipeline.DataPipeline"` or trigger the notebook
- The refresh only pulls what the source provides; if the source is stale, the refresh will succeed but show no new data
Step 6: Cancel (if needed)
To cancel an in-progress enhanced refresh, first retrieve the `requestId` from the refresh history:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1"
The response includes a `requestId` field. Use it to cancel:
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes/<requestId>" \ -X delete
Only works for refreshes triggered via the Enhanced API (not scheduled or portal refreshes).
Using the Refresh Script
The **`scripts/refresh_model.py`** script wraps the Enhanced Refresh API with CLI arguments:
# Full refresh uv run scripts/refresh_model.py -w $WS_ID -m $MODEL_ID # Refresh specific tables uv run scripts/refresh_model.py -w $WS_ID -m $MODEL_ID --tables Sales,Calendar # Refresh specific partitions
Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports, and AI dashboards. Includes Microsoft Fabric skills and Fabric agents. Weekly updates.
Repo: data-goblin/power-bi-agentic-development
Other skills on power-bi-agentic-development.
- /deneb-visuals
Deneb visual creation, Vega/Vega-Lite spec authoring, and Deneb best practices for PBIR reports. Automatically invoke whenever the user mentions "Deneb" in any context, or asks about Vega/Vega-Lite specs in Power BI, Deneb cross-filtering, Deneb interactivity, pbiColor theme
Open skill - /powerbi-custom-visuals
Power BI custom visual (.pbiviz) development with the pbiviz toolchain and its MCP server. Automatically invoke when the user mentions "custom visual", "pbiviz", "develop a Power BI visual", "powerbi-visuals-tools", "IVisual", "capabilities.json", "visual formatting model",
Open skill - /python-visuals
Python visual creation and matplotlib/seaborn patterns for PBIR reports. Automatically invoke when the user mentions "Python visual", "matplotlib in Power BI", "seaborn in Power BI", "pythonVisual", or asks to "create a Python visual", "add a matplotlib chart", "write a Python
Open skill - /r-visuals
R visual creation and ggplot2 patterns for PBIR reports. Automatically invoke when the user mentions "R visual", "ggplot2", "ggplot in Power BI", or asks to "create an R visual", "add an R chart", "write an R visual script", "inject an R script into Power BI".
Open skill - /svg-visuals
SVG generation via DAX measures and extension measures with ImageUrl data category for inline visualizations in PBIR reports. Automatically invoke when the user mentions "SVG visual", "DAX sparkline", "SVG measure", "inline graphics with DAX", "ImageUrl data category",
Open skill - /executing-spark
Execute arbitrary Python or PySpark code on Fabric Spark compute without creating a notebook artifact; ephemeral Livy sessions with full Delta table access. Automatically invoke when the user asks to "run PySpark in Fabric", "create a Livy session", "execute Python on Fabric
Open skill

