ruiromano/powerbi-agentic-plugins/powerbi-semantic-model-authoring
Claude Code and agent skill by ruiromano/powerbi-agentic-plugins
- community
Checking that the SKILL.md file is still in the repository.
Develops and manages Power BI Semantic Models. Handles connecting to semantic models for analysis and all development operations including (1) Creating new models, (2) Creating/editing measures using DAX, (3) Creating/editing tables and relationships, (4) Analyzing model best practices, (5) Deploying models to Fabric workspace, (6) Working with PBIP projects containing semantic models, (7) Troubleshooting DAX performance, (8) Refreshing semantic models in Desktop or Fabric service, (9) Creating or editing TMDL code or TMDL files. Does NOT handle report layout/visual authoring, or workspace/pipeline administration (use fabric-cli).
Install
npx vskill@latest install ruiromano/powerbi-agentic-plugins/powerbi-semantic-model-authoringSKILL.md
Power BI Semantic Model Skill
This skill provides guidance on how to develop Power BI semantic models.
References
- modeling-guidelines: General best practices for modeling, including star schema design, naming conventions, and DAX measure patterns.
- direct-lake-guidelines: Specific guidelines for working with Direct Lake semantic models, including partition source types and limitations.
- TMDL: Reference for TMDL syntax and properties when working with TMDL code and files.
- pbip.md: Guidelines for working with Power BI Project files (PBIP) that contain semantic models.
- dax-udf-functions-guidelines: Guidelines for creating and using DAX User-Defined Functions (UDFs) to centralize business logic in the model.
- dax-query-guidelines: Guidelines for writing DAX queries against the semantic model for validation and analysis.
- dax-performance-optimization: Guidelines for DAX performance optimization, including storage engine vs. formula engine analysis, anti-pattern detection, and optimization strategies.
IMPORTANT
- Respect the Tool Selection Priority.
- If asked to work with TMDL code or *.tmdl files, load the TMDL reference to understand the syntax and properties of TMDL objects.
- If asked to export or save the semantic model to a PBIP project, make sure you understand the PBIP explained in references/pbip.md.
Tool Selection Priority
When deciding which tool to use for semantic model operations, follow this priority order:
- MCP Server available → Use
powerbi-modeling-mcptools for all operations (create, edit, deploy, query) both against server or local folders. Unless the user specifically requests working with TMDL files. - MCP Server unavailable + PBIP folder exists → Edit TMDL files directly.
- MCP Server unavailable + Fabric workspace → Use
fabric-cliskill to export the model, edit the TMDL files locally, then re-deploy. - MCP Server unavailable + Power BI Desktop → Guide the user to save as PBIP folder or enable the MCP server.
Relationship to Other Skills
- fabric-cli: Use for workspace operations, deploying, and exploring OneLake data sources.
- powerbi-pbir: Use when the user also needs a report alongside the semantic model.
Pre-development: Understand the Model
Before making any changes to an existing model, always gather context first.
- List all tables — Understand the existing tables and their storage modes (Import, DirectQuery, Direct Lake).
- List existing relationships — Map out the current star schema structure.
- List existing measures — Avoid creating duplicates and understand existing calculation patterns.
- Check naming conventions — Identify established patterns so new objects remain consistent (Consistency Over Perfection principle from modeling-guidelines).
- Identify model storage mode — Determine if the model storage mode is Import, DirectQuery, Direct Lake, or Composite. This dictates which partition types and guidelines apply.
Task: Edit or Create TMDL code or *.tmdl files
When working with TMDL code directly, follow these guidelines:
- Load the TMDL reference to understand the syntax and properties of TMDL objects.
- Pay attention to the structure and indentation of the TMDL code, as it defines the hierarchy of objects (database > tables > columns/measures).
Task: Connect to an existing semantic model
A semantic model can be loaded from the following locations:
- Power BI Desktop: Use
powerbi-modeling-mcptools to find the Power BI Desktop local instance and connect to it. - Fabric workspace: Use
powerbi-modeling-mcptools to connect to the semantic model in the workspace, make sure to use the exact workspace and semantic model name. Or use the Fabric CLI (fab) to export the semantic model code. - Power BI Project files (PBIP): Use
powerbi-modeling-mcptools to connect to the PBIP folder.
Task: Create a new semantic model
- Gather requirements — Ask the user for: purpose of the model, data source type (SQL Server, Lakehouse, etc.), and key business entities/facts to model.
- Determine model storage mode — If the data source is Fabric OneLake > Direct Lake (see Task: Create a new Direct Lake model). Otherwise > Import mode.
- Create the database — Create a new empty semantic model database with compatibility level 1702 or higher.
- Create data source parameters — (Skip for Direct Lake) Create semantic model M parameters for the data sources (
Server,Database, etc.), and use them in the partition M code. This makes it easier to rebind the model and helps with deployments. - Analyze source schema — Use
powerbi-modeling-mcptools or Fabric CLI to inspect the source tables, columns, and data types. - Design star schema — Identify fact and dimension tables, define relationship keys. Follow modeling-guidelines.
- Create tables — Add partitions with correct source type, create columns with proper data types and
sourceColumnmapping. - Create relationships — Define relationships between fact and dimension tables before creating measures.
- Create measures — Add explicit measures for aggregatable columns. Follow DAX guidelines in modeling-guidelines.
- Save/Deploy — Export to PBIP project or deploy to workspace.
Task: Create a new Direct Lake model
- Connect to OneLake — Connect to the OneLake data sources (e.g. Lakehouse) and understand the schema. If you don't have specific OneLake tools, use the
fabric-cliskill to explore the OneLake data. - Create database — Use the Power BI Modeling MCP Server to create a new offline database with compatibility level 1702 or higher.
- Create the named expression — Create a shared named expression for the Direct Lake connection using
AzureStorage.DataLakeconnector (see direct-lake-guidelines). - Create tables — Using the schema from the lakehouse, add semantic model tables using
EntityPartitionSourcewithdirectLakemode. Map columns to the OneLake table columns. - Create relationships and measures — Follow modeling-guidelines.
Task: Edit an existing semantic model
Use this workflow when the user wants to add/modify/remove measures, tables, columns, or relationships in an existing model.
- Connect to the model — Determine source (PBIP folder, Desktop, Fabric workspace) and connect via MCP or locate the TMDL files.
- Run Pre-development discovery — Follow the Pre-development steps to understand the current model state.
- Plan changes — Based on the user request, identify exactly what needs to be added, modified, or removed. Check for naming conflicts and duplicates.
- Determine model storage mode — IMPORTANT: If it's a Direct Lake semantic model, refer to direct-lake-guidelines. Otherwise, follow modeling-guidelines.
- Execute changes — Apply modifications:
- If adding tables: create partitions first, then columns, then relationships, then measures.
- If adding measures: verify referenced columns/tables exist, test with a simple DAX query.
- If adding relationships: ensure key columns exist on both sides with matching data types.
- If the data source is Fabric OneLake, you can use the Fabric CLI to analyze the table schemas.
- Validate — Run the Post-development validation steps.
- Save — If PBIP source, export to PBIP (see pbip.md). If online, save to workspace.
Post-development: Validate Changes
After any model modification, always verify your work:
- Check the PBIP structure - If the model is sourced from a PBIP folder, ensure the folder structure and files are correct (see pbip.md).
- Test new measures — For each new measure, run a simple DAX query to validate it returns expected results (e.g.,
EVALUATE { [Measure Name] }). - Verify relationships — For new relationships, confirm cardinality, cross-filter direction, and that key columns have matching data types.
- Verify table columns — For new tables, confirm all columns have correct
sourceColumnmapping anddataType. - Check for duplicates — Ensure no duplicate measures (same DAX expression) or orphan objects were introduced.
If any check fails, fix the issue and re-run validation from step 1. Only proceed to Save when all checks pass.
Task: Run Best Practice Analysis (BPA) rules
Run the script scripts/bpa.ps1 against the semantic model. If no specific BPA rules are mentioned, use the default set of rules in scripts/bpa-rules-semanticmodel.json. The script runs the BPA rules using Tabular Editor 2.0.
This is specially useful when user wants to enforce static rules to ensure model consistency and adherence to best practices. For example, you can create custom BPA rules to check for specific naming conventions, required documentation, or to prevent certain anti-patterns in the model.
CRITICAL:
- If there is no semantic model in the context, prompt the user for the location of the semantic model.
- If the model is stored on your local file system, ensure you select a folder that contains either a database.tmdl, model.tmdl, or model.bim file.
If the model is running in a local or remote server, call the script like this:
Report findings with severity levels (Critical, High, Medium, Info).
Task: Deploy a semantic model code to Fabric Workspace
- Ensure the model is loaded in MCP.
- Use
powerbi-modeling-mcp:database_operationswithDeployoperation. - Specify the target workspace and semantic model name.
- Verify the deployment succeeded by listing the workspace items.
If powerbi-modeling-mcp is unavailable, ensure the model is saved in PBIP format (see pbip.md) and use the fabric-cli skill to deploy.
Task: Refresh a Semantic Model
Refresh is only possible when working against a live model in Power BI Desktop or Fabric Service. If working with local TMDL files, instruct the user to deploy the model to a workspace or open it in Power BI Desktop to enable refresh capabilities.
Determine the refresh target:
- Power BI Desktop -> Use
powerbi-modeling-mcpRefresh tools to refresh individual tables or the entire model. - Fabric Service + MCP available -> Connect to the semantic model in the workspace and use
powerbi-modeling-mcpRefresh tools. - Fabric Service + no MCP -> Use the Power BI Enhanced Refresh API (
POST /groups/{groupId}/datasets/{datasetId}/refreshes) and poll the refresh status endpoint to check completion.
Credential Configuration Errors (Service only)
If the refresh fails with an error indicating missing or invalid data source credentials stop immediately and instruct the user to configure the data source connections manually in Power BI Service.
Do not attempt to retry or work around credential errors programmatically.
Task: Refactor Measures Using DAX UDFs to Centralize and Reuse Business Logic
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/powerbi/skills/powerbi-semantic-model-authoring/SKILL.md
Popularity
- Repository stars
- 61
- Repository forks
- 12
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ruiromano/powerbi-agentic-plugins/powerbi-semantic-model-authoring)