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.

referencesMEASURES-DAX.md

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

DAX Measures and Naming Conventions

Naming Conventions

General Rules

  • Use human-readable names (spaces allowed)
  • Be descriptive: Total Sales Amount not TSA
  • Avoid abbreviations unless universally understood
  • Use consistent capitalization (Title Case recommended)
  • Avoid special characters except spaces

Table Naming

Type Convention Example
Dimension Singular noun Customer, Product, Date
Fact Business process Sales, Orders, Inventory
Bridge Combined names CustomerAccount, ProductCategory
Measure Table Underscore prefix _Measures, _KPIs

Column Naming

Type Convention Example
Keys Suffix with "Key" or "ID" CustomerKey, ProductID
Dates Suffix with "Date" OrderDate, ShipDate
Amounts Descriptive with unit hint SalesAmount, QuantitySold
Flags Prefix with "Is" or "Has" IsActive, HasDiscount

Measure Naming

Type Convention Example
Aggregations Verb + Noun Total Sales, Count of Orders
Ratios X per Y or X Rate Sales per Customer, Conversion Rate
Time Intelligence Period + Metric YTD Sales, PY Total Sales
Comparisons Metric + vs + Baseline Sales vs Budget, Growth vs PY

Explicit vs Implicit Measures

Always Create Explicit Measures For:

  1. Key business metrics users will query
  2. Complex calculations with filter manipulation
  3. Measures used in MDX (Excel PivotTables)
  4. Controlled aggregation (prevent sum of averages)

Implicit Measures (Column Aggregations)

  • Acceptable for simple exploration
  • Set correct SummarizeBy property:
    • Amounts: Sum
    • Keys/IDs: None (Do Not Summarize)
    • Rates/Prices: None or Average

Measure Patterns

Basic Aggregations

Total Sales = SUM(Sales[SalesAmount])
Order Count = COUNTROWS(Sales)
Average Order Value = DIVIDE([Total Sales], [Order Count])
Distinct Customers = DISTINCTCOUNT(Sales[CustomerKey])

Time Intelligence (Requires Date Table)

YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])
MTD Sales = TOTALMTD([Total Sales], 'Date'[Date])
PY Sales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
YoY Growth = DIVIDE([Total Sales] - [PY Sales], [PY Sales])

Percentage Calculations

Sales % of Total = 
DIVIDE(
    [Total Sales],
    CALCULATE([Total Sales], REMOVEFILTERS(Product))
)

Margin % = DIVIDE([Gross Profit], [Total Sales])

Running Totals

Running Total = 
CALCULATE(
    [Total Sales],
    FILTER(
        ALL('Date'),
        'Date'[Date] <= MAX('Date'[Date])
    )
)

Column References

Best Practice: Always Qualify Column Names

// GOOD - Fully qualified
Sales Amount = SUM(Sales[SalesAmount])

// BAD - Unqualified (can cause ambiguity)
Sales Amount = SUM([SalesAmount])

Measure References: Never Qualify

// GOOD - Unqualified measure
YTD Sales = TOTALYTD([Total Sales], 'Date'[Date])

// BAD - Qualified measure (breaks if home table changes)
YTD Sales = TOTALYTD(Sales[Total Sales], 'Date'[Date])

Documentation

Measure Descriptions

Always add descriptions explaining:

  • What the measure calculates
  • Business context/usage
  • Any important assumptions
measure_operations(
  operation: "Update",
  definitions: [{
    name: "Total Sales",
    tableName: "Sales",
    description: "Sum of all completed sales transactions. Excludes returns and cancelled orders."
  }]
)

Format Strings

Data Type Format String Example Output
Currency $#,##0.00 $1,234.56
Percentage 0.0% 12.3%
Whole Number #,##0 1,234
Decimal #,##0.00 1,234.56

Display Folders

Organize measures into logical groups:

measure_operations(
  operation: "Update",
  definitions: [{
    name: "YTD Sales",
    tableName: "_Measures",
    displayFolder: "Time Intelligence\\Year"
  }]
)

Common folder structure:

_Measures
├── Sales
│   ├── Total Sales
│   └── Average Sale
├── Time Intelligence
│   ├── Year
│   │   ├── YTD Sales
│   │   └── PY Sales
│   └── Month
│       └── MTD Sales
└── Ratios
    ├── Margin %
    └── Conversion Rate

Variables for Performance

Use variables to:

  • Avoid recalculating the same expression
  • Improve readability
  • Enable debugging
Gross Margin % = 
VAR TotalSales = [Total Sales]
VAR TotalCost = [Total Cost]
VAR GrossProfit = TotalSales - TotalCost
RETURN
    DIVIDE(GrossProfit, TotalSales)

Validation Checklist

  • All key business metrics have explicit measures
  • Measures have clear, descriptive names
  • Measures have descriptions
  • Appropriate format strings applied
  • Display folders organize related measures
  • Column references are fully qualified
  • Measure references are not qualified
  • Variables used for complex calculations

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.