Powerbi Modeling
GitHubOfficialFirst committed by AlahmadiQ8Distributed by GitHub
- Skill
- Tool integration
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Power BI Modeling assistant helps users design and maintain efficient semantic models. It enforces Microsoft best practices by connecting directly to active models to analyze structure, relationships, and DAX measures. The skill provides guidance on star schema design, performance tuning, row-level security, and naming conventions, ensuring models are well-documented and optimized for report performance.
What it does
- Connects to active Power BI models to inspect tables, relationships, and measures.
- Provides guidance on designing star schemas and configuring model relationships.
- Assists in writing and optimizing DAX measures and calculated columns.
- Implements row-level security and model documentation standards.
- Offers performance tuning advice, including data reduction and column optimization.
- Validates models against established naming conventions and best practices.
When to use it
- When creating a new Power BI semantic model from scratch.
- When troubleshooting performance issues in an existing model.
- When needing to define complex DAX measures or calculation groups.
- When standardizing naming conventions and documentation across a model.
- When configuring security roles or complex relationship cardinalities.
Advantages
- Ensures adherence to official Microsoft Power BI modeling best practices.
- Automates the inspection of model health and structure.
- Reduces manual effort in documenting and organizing semantic models.
- Provides actionable performance optimization techniques for DAX and data structures.
- Maintains consistency through standardized naming and folder organization.
Usage examples
- “Create a new measure for Total Sales with a currency format and description.”
- The agent will use measure_operations to create the 'Total Sales' measure with the specified expression, format string, and documentation.
- “Analyze my current model and suggest performance improvements.”
- The agent will list tables, relationships, and measures, then identify opportunities like removing unused columns or optimizing relationship cardinalities.
- “How should I name my dimension and fact tables?”
- The agent will provide the recommended naming conventions, such as using singular nouns for dimensions and business process names for fact tables.
- “Create a relationship between my Sales and Customer tables.”
- The agent will verify the columns and use relationship_operations to establish a one-to-many relationship with the correct cross-filtering behavior.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/github/powerbi-modeling/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip powerbi-modeling.zip -d .agents/skills
Documentation by AlahmadiQ8
Power BI Semantic Modeling
Guide users in building optimized, well-documented Power BI semantic models following Microsoft best practices.
When to Use This Skill
Use this skill when users ask about:
Creating or optimizing Power BI semantic models
Designing star schemas (dimension/fact tables)
Writing DAX measures or calculated columns
Configuring table relationships (cardinality, cross-filter)
Implementing row-level security (RLS)
Naming conventions for tables, columns, measures
Adding descriptions and documentation to models
Performance tuning and optimization
Calculation groups and field parameters
Model validation and best practice checks
Trigger phrases: "create a measure", "add relationship", "star schema", "optimize model", "DAX formula", "RLS", "naming convention", "model documentation", "cardinality", "cross-filter"
Prerequisites
Required Tools
Power BI Modeling MCP Server: Required for connecting to and modifying semantic models
Enables: connection_operations, table_operations, measure_operations, relationship_operations, etc.
Must be configured and running to interact with models
Optional Dependencies
Microsoft Learn MCP Server: Recommended for researching latest best practices
Enables: microsoft_docs_search, microsoft_docs_fetch
Use for complex scenarios, new features, and official documentation
Workflow
1. Connect and Analyze First
Before providing any modeling guidance, always examine the current model state:
1. List connections: connection_operations(operation: "ListConnections")
2. If no connection, check for local instances: connection_operations(operation: "ListLocalInstances")
3. Connect to the model (Desktop or Fabric)
4. Get model overview: model_operations(operation: "Get")
5. List tables: table_operations(operation: "List")
6. List relationships: relationship_operations(operation: "List")
7. List measures: measure_operations(operation: "List")2. Evaluate Model Health
After connecting, assess the model against best practices:
Star Schema: Are tables properly classified as dimension or fact?
Relationships: Correct cardinality? Minimal bidirectional filters?
Naming: Human-readable, consistent naming conventions?
Documentation: Do tables, columns, measures have descriptions?
Measures: Explicit measures for key calculations?
Hidden Fields: Are technical columns hidden from report view?
3. Provide Targeted Guidance
Based on analysis, guide improvements using references:
Star schema design: See STAR-SCHEMA.md
Relationship configuration: See RELATIONSHIPS.md
DAX measures and naming: See MEASURES-DAX.md
Performance optimization: See PERFORMANCE.md
Row-level security: See RLS.md
Quick Reference: Model Quality Checklist
| Area | Best Practice |
|---|---|
| Tables | Clear dimension vs fact classification |
| Naming | Human-readable: Customer Name not CUST_NM |
| Descriptions | All tables, columns, measures documented |
| Measures | Explicit DAX measures for business metrics |
| Relationships | One-to-many from dimension to fact |
| Cross-filter | Single direction unless specifically needed |
| Hidden fields | Hide technical keys, IDs from report view |
| Date table | Dedicated marked date table |
MCP Tools Reference
Use these Power BI Modeling MCP operations:
| Operation Category | Key Operations |
|---|---|
connection_operations | Connect, ListConnections, ListLocalInstances, ConnectFabric |
model_operations | Get, GetStats, ExportTMDL |
table_operations | List, Get, Create, Update, GetSchema |
column_operations | List, Get, Create, Update (descriptions, hidden, format) |
measure_operations | List, Get, Create, Update, Move |
relationship_operations | List, Get, Create, Update, Activate, Deactivate |
dax_query_operations | Execute, Validate |
calculation_group_operations | List, Create, Update |
security_role_operations | List, Create, Update, GetEffectivePermissions |
Common Tasks
Add Measure with Description
measure_operations(
operation: "Create",
definitions: [{
name: "Total Sales",
tableName: "Sales",
expression: "SUM(Sales[Amount])",
formatString: "$#,##0",
description: "Sum of all sales amounts"
}]
)Update Column Description
column_operations(
operation: "Update",
definitions: [{
tableName: "Customer",
name: "CustomerKey",
description: "Unique identifier for customer dimension",
isHidden: true
}]
)Create Relationship
relationship_operations(
operation: "Create",
definitions: [{
fromTable: "Sales",
fromColumn: "CustomerKey",
toTable: "Customer",
toColumn: "CustomerKey",
crossFilteringBehavior: "OneDirection"
}]
)When to Use Microsoft Learn MCP
Research current best practices using microsoft_docs_search for:
Latest DAX function documentation
New Power BI features and capabilities
Complex modeling scenarios (SCD Type 2, many-to-many)
Performance optimization techniques
Security implementation patterns
Files
- ATTRIBUTION.mdAdded by AutoGineer869 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md5.8 KiB
- references/MEASURES-DAX.md4.9 KiB
- references/PERFORMANCE.md5.3 KiB
- references/RELATIONSHIPS.md3.4 KiB
- references/RLS.md5.3 KiB
- references/STAR-SCHEMA.md3.1 KiB
references/PERFORMANCE.md
Performance Optimization for Power BI Models
Data Reduction Techniques
1. Remove Unnecessary Columns
Only import columns needed for reporting
Remove audit columns (CreatedBy, ModifiedDate) unless required
Remove duplicate/redundant columns
column_operations(operation: "List", filter: { tableNames: ["Sales"] })
// Review and remove unneeded columns2. Remove Unnecessary Rows
Filter historical data to relevant period
Exclude cancelled/void transactions if not needed
Apply filters in Power Query (not in DAX)
3. Reduce Cardinality
High cardinality (many unique values) impacts:
Model size
Refresh time
Query performance
Solutions:
| Column Type | Reduction Technique |
|---|---|
| DateTime | Split into Date and Time columns |
| Decimal precision | Round to needed precision |
| Text with patterns | Extract common prefix/suffix |
| High-precision IDs | Use surrogate integer keys |
4. Optimize Data Types
| From | To | Benefit |
|---|---|---|
| DateTime | Date (if time not needed) | 8 bytes to 4 bytes |
| Decimal | Fixed Decimal | Better compression |
| Text with numbers | Whole Number | Much better compression |
| Long text | Shorter text | Reduces storage |
5. Group and Summarize
Pre-aggregate data when detail not needed:
Daily instead of transactional
Monthly instead of daily
Consider aggregation tables for DirectQuery
Column Optimization
Prefer Power Query Columns Over Calculated Columns
| Approach | When to Use |
|---|---|
| Power Query (M) | Can be computed at source, static values |
| Calculated Column (DAX) | Needs model relationships, dynamic logic |
Power Query columns:
Load faster
Compress better
Use less memory
Avoid Calculated Columns on Relationship Keys
DAX calculated columns in relationships:
Cannot use indexes
Generate complex SQL for DirectQuery
Hurt performance significantly
Use COMBINEVALUES for multi-column relationships:
// If you must use calculated column for composite key
CompositeKey = COMBINEVALUES(",", [Country], [City])Set Appropriate Summarization
Prevent accidental aggregation of non-additive columns:
column_operations(
operation: "Update",
definitions: [{
tableName: "Product",
name: "UnitPrice",
summarizeBy: "None"
}]
)Relationship Optimization
1. Minimize Bidirectional Relationships
Each bidirectional relationship:
Increases query complexity
Can create ambiguous paths
Reduces performance
2. Avoid Many-to-Many When Possible
Many-to-many relationships:
Generate more complex queries
Require more memory
Can produce unexpected results
3. Reduce Relationship Cardinality
Keep relationship columns low cardinality:
Use integer keys over text
Consider higher-grain relationships
DAX Optimization
1. Use Variables
// GOOD - Calculate once, use twice
Sales Growth =
VAR CurrentSales = [Total Sales]
VAR PriorSales = [PY Sales]
RETURN DIVIDE(CurrentSales - PriorSales, PriorSales)
// BAD - Recalculates [Total Sales] and [PY Sales]
Sales Growth =
DIVIDE([Total Sales] - [PY Sales], [PY Sales])2. Avoid FILTER with Entire Tables
// BAD - Iterates entire table
Sales High Value =
CALCULATE([Total Sales], FILTER(Sales, Sales[Amount] > 1000))
// GOOD - Uses column reference
Sales High Value =
CALCULATE([Total Sales], Sales[Amount] > 1000)3. Use KEEPFILTERS Appropriately
// Respects existing filters
Sales with Filter =
CALCULATE([Total Sales], KEEPFILTERS(Product[Category] = "Bikes"))4. Prefer DIVIDE Over Division Operator
// GOOD - Handles divide by zero
Margin % = DIVIDE([Profit], [Sales])
// BAD - Errors on zero
Margin % = [Profit] / [Sales]DirectQuery Optimization
1. Minimize Columns and Tables
DirectQuery models:
Query source for every visual
Performance depends on source
Minimize data retrieved
2. Avoid Complex Power Query Transformations
Transforms become subqueries
Native queries are faster
Materialize at source when possible
3. Keep Measures Simple Initially
Complex DAX generates complex SQL:
Start with basic aggregations
Add complexity gradually
Monitor query performance
4. Disable Auto Date/Time
For DirectQuery models, disable auto date/time:
Creates hidden calculated tables
Increases model complexity
Use explicit date table instead
Aggregations
User-Defined Aggregations
Pre-aggregate fact tables for:
Very large models (billions of rows)
Hybrid DirectQuery/Import
Common query patterns
table_operations(
operation: "Create",
definitions: [{
name: "SalesAgg",
mode: "Import",
mExpression: "..."
}]
)Performance Testing
Use Performance Analyzer
Enable in Power BI Desktop
Start recording
Interact with visuals
Review DAX query times
Monitor with DAX Studio
External tool for:
Query timing
Server timings
Query plans
Validation Checklist
[ ] Unnecessary columns removed
[ ] Appropriate data types used
[ ] High-cardinality columns addressed
[ ] Bidirectional relationships minimized
[ ] DAX uses variables for repeated expressions
[ ] No FILTER on entire tables
[ ] DIVIDE used instead of division operator
[ ] Auto date/time disabled for DirectQuery
[ ] Performance tested with representative data
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
AlahmadiQ8
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/powerbi-modeling · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- AlahmadiQ8
AutoGineer is not affiliated with or endorsed by AlahmadiQ8 or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download powerbi-modeling.zip