Index of every page on this site: llms.txt
All skills
github avatar

/powerbi-modeling

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/powerbi-modeling

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesRELATIONSHIPS.md

≈874 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Relationships in Power BI

Relationship Properties

Cardinality

Type Use Case Notes
One-to-Many (*:1) Dimension to Fact Most common, preferred
Many-to-One (1:*) Fact to Dimension Same as above, direction reversed
One-to-One (1:1) Dimension extensions Use sparingly
Many-to-Many (:) Bridge tables, complex scenarios Requires careful design

Cross-Filter Direction

Setting Behavior When to Use
Single Filters flow from "one" to "many" Default, best performance
Both Filters flow in both directions Only when necessary

Best Practices

1. Prefer One-to-Many Relationships

Customer (1) --> (*) Sales
Product  (1) --> (*) Sales
Date     (1) --> (*) Sales

2. Use Single-Direction Cross-Filtering

Bidirectional filtering:

  • Impacts performance negatively
  • Can create ambiguous filter paths
  • May produce unexpected results

Only use bidirectional when:

  • Dimension-to-dimension analysis through fact table
  • Specific RLS requirements

Better alternative: Use CROSSFILTER in DAX measures:

Countries Sold = 
CALCULATE(
    DISTINCTCOUNT(Customer[Country]),
    CROSSFILTER(Customer[CustomerKey], Sales[CustomerKey], BOTH)
)

3. One Active Path Between Tables

  • Only one active relationship between any two tables
  • Use USERELATIONSHIP for role-playing dimensions:
Sales by Ship Date = 
CALCULATE(
    [Total Sales],
    USERELATIONSHIP(Sales[ShipDate], Date[Date])
)

4. Avoid Ambiguous Paths

Circular references cause errors. Solutions:

  • Deactivate one relationship
  • Restructure model
  • Use USERELATIONSHIP in measures

Relationship Patterns

Standard Star Schema

     [Date]
       |
[Product]--[Sales]--[Customer]
       |
   [Store]

Role-Playing Dimension

[Date] --(active)-- [Sales.OrderDate]
   |
   +--(inactive)-- [Sales.ShipDate]

Bridge Table (Many-to-Many)

[Customer]--(*)--[CustomerAccount]--(*)--[Account]

Factless Fact Table

[Product]--[ProductPromotion]--[Promotion]

Used to capture relationships without measures.

Creating Relationships via MCP

List Current Relationships

relationship_operations(operation: "List")

Create New Relationship

relationship_operations(
  operation: "Create",
  definitions: [{
    fromTable: "Sales",
    fromColumn: "ProductKey",
    toTable: "Product", 
    toColumn: "ProductKey",
    crossFilteringBehavior: "OneDirection",
    isActive: true
  }]
)

Deactivate Relationship

relationship_operations(
  operation: "Deactivate",
  references: [{ name: "relationship-guid-here" }]
)

Troubleshooting

"Ambiguous Path" Error

Multiple active paths exist between tables.

  • Check for: Multiple fact tables sharing dimensions
  • Solution: Deactivate redundant relationships

Bidirectional Not Allowed

Circular reference would be created.

  • Solution: Restructure or use DAX CROSSFILTER

Relationship Not Detected

Columns may have different data types.

  • Ensure both columns have identical types
  • Check for trailing spaces in text keys

Validation Checklist

  • All relationships are one-to-many where possible
  • Cross-filter is single direction by default
  • Only one active path between any two tables
  • Role-playing dimensions use inactive relationships
  • No circular reference paths
  • Key columns have matching data types

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill facilitates Power BI semantic modeling by connecting to active models and applying Microsoft best practices. It includes a potential attack surface for indirect prompt injection because it ingests metadata and data from Power BI models, though no malicious behavior or safety bypasses were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    5/6 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 10 months ago
  • power-bi
  • dax
  • semantic-modeling
  • star-schema
  • relationships
  • rls
  • measures
  • performance-tuning
  • data-modeling

README badge

README badge for github/awesome-copilot/powerbi-modeling

Assists with building and optimizing Power BI semantic models by analyzing the active model and providing guidance on star schemas, DAX measures, relationships, RLS, and performance tuning. Connects to Power BI Desktop or Fabric via MCP tools to inspect table structure, relationships, and measures before recommending improvements aligned with Microsoft best practices.

Generated from the current SKILL.md.

Does this skill work with Power BI Desktop and Fabric semantic models?
Yes. The skill connects to both Power BI Desktop instances and Fabric models via the Power BI Modeling MCP Server using connection_operations with ConnectFabric support.
What do I need to set up before using this skill?
The Power BI Modeling MCP Server must be configured and running. The Microsoft Learn MCP Server is optional but recommended for researching latest best practices and DAX documentation.
Can this skill write DAX measures and create relationships in my model?
Yes. The skill can create measures with measure_operations, create relationships with relationship_operations, update column metadata, and modify model structure via the bundled MCP tools.
Does this skill help with row-level security (RLS)?
Yes. The skill provides guidance on implementing RLS and can interact with security roles via security_role_operations to list, create, and update role definitions.
What happens if I ask about a modeling scenario the skill doesn't recognize?
The skill will first connect to your model to analyze the current state, then provide targeted guidance based on Power BI best practices and Microsoft Learn documentation if needed.

Generated from the current SKILL.md. These answers refresh after source changes.