Generated banner for Powerbi Modeling
Generated logo for Powerbi Modeling

Powerbi Modeling

GitHubOfficialFirst committed by AlahmadiQ8Distributed by GitHub

  • Skill
  • Tool integration
  • Data and AI
  • MIT
  • No issues found

From the author

Power BI semantic modeling assistant for building optimized data models. Use when working with Power BI semantic models, creating measures, designing star schemas, configuring relationships, implementing RLS, or optimizing model performance. Triggers on queries about DAX calculations, table relationships, dimension/fact table design, naming conventions, model documentation, cardinality, cross-filter direction, calculation groups, and data model best practices. Always connects to the active model first using power-bi-modeling MCP tools to understand the data structure before providing guidance.
— the description by AlahmadiQ8

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

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/github/powerbi-modeling/download
  2. Unzip 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:

Quick Reference: Model Quality Checklist

AreaBest Practice
TablesClear dimension vs fact classification
NamingHuman-readable: Customer Name not CUST_NM
DescriptionsAll tables, columns, measures documented
MeasuresExplicit DAX measures for business metrics
RelationshipsOne-to-many from dimension to fact
Cross-filterSingle direction unless specifically needed
Hidden fieldsHide technical keys, IDs from report view
Date tableDedicated marked date table

MCP Tools Reference

Use these Power BI Modeling MCP operations:

Operation CategoryKey Operations
connection_operationsConnect, ListConnections, ListLocalInstances, ConnectFabric
model_operationsGet, GetStats, ExportTMDL
table_operationsList, Get, Create, Update, GetSchema
column_operationsList, Get, Create, Update (descriptions, hidden, format)
measure_operationsList, Get, Create, Update, Move
relationship_operationsList, Get, Create, Update, Activate, Deactivate
dax_query_operationsExecute, Validate
calculation_group_operationsList, Create, Update
security_role_operationsList, 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

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 columns
2. 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 TypeReduction Technique
DateTimeSplit into Date and Time columns
Decimal precisionRound to needed precision
Text with patternsExtract common prefix/suffix
High-precision IDsUse surrogate integer keys
4. Optimize Data Types
FromToBenefit
DateTimeDate (if time not needed)8 bytes to 4 bytes
DecimalFixed DecimalBetter compression
Text with numbersWhole NumberMuch better compression
Long textShorter textReduces 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
ApproachWhen 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
  1. Enable in Power BI Desktop

  2. Start recording

  3. Interact with visuals

  4. 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
GitHub avatar of AlahmadiQ8AlahmadiQ8
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