@luquimbo/bi-superpowers 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +46 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +4 -0
- package/AGENTS.md +34 -7
- package/README.md +139 -118
- package/bin/cli.js +45 -31
- package/bin/commands/install.js +321 -0
- package/bin/lib/microsoft-mcp.js +8 -0
- package/bin/lib/microsoft-mcp.test.js +5 -0
- package/package.json +1 -1
- package/skills/contributions/SKILL.md +1 -1
- package/skills/data-model-design/SKILL.md +1 -1
- package/skills/data-modeling/SKILL.md +82 -56
- package/skills/data-quality/SKILL.md +1 -1
- package/skills/dax/SKILL.md +74 -36
- package/skills/dax-doctor/SKILL.md +1 -1
- package/skills/dax-udf/SKILL.md +1 -1
- package/skills/deployment/SKILL.md +1 -1
- package/skills/excel-formulas/SKILL.md +1 -1
- package/skills/fabric-scripts/SKILL.md +1 -1
- package/skills/fast-standard/SKILL.md +1 -1
- package/skills/governance/SKILL.md +103 -50
- package/skills/migration-assistant/SKILL.md +1 -1
- package/skills/model-documenter/SKILL.md +1 -1
- package/skills/pbi-connect/SKILL.md +1 -1
- package/skills/power-query/SKILL.md +1 -1
- package/skills/project-kickoff/SKILL.md +1 -1
- package/skills/query-performance/SKILL.md +1 -1
- package/skills/report-design/SKILL.md +1 -1
- package/skills/report-layout/SKILL.md +1 -1
- package/skills/rls-design/SKILL.md +1 -1
- package/skills/semantic-model/SKILL.md +1 -1
- package/skills/testing-validation/SKILL.md +1 -1
- package/skills/theme-tweaker/SKILL.md +1 -1
- package/src/content/mcp-requirements.json +13 -0
- package/src/content/skills/data-modeling.md +81 -55
- package/src/content/skills/dax.md +73 -35
- package/src/content/skills/governance.md +102 -49
package/skills/dax/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "dax"
|
|
3
3
|
description: "Use when the user asks about DAX Skill, especially phrases like \"DAX\", \"CALCULATE\", \"time intelligence\", \"SUMX\", \"context transition\", \"Power BI formula\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/dax.md instead. -->
|
|
@@ -23,10 +23,13 @@ You are a **DAX Expert** specializing in efficient measure design, context manip
|
|
|
23
23
|
|
|
24
24
|
## MANDATORY RULES
|
|
25
25
|
1. **USE VARIABLES.** Always use VAR/RETURN for any calculation used more than once.
|
|
26
|
-
2. **
|
|
27
|
-
3. **
|
|
28
|
-
4.
|
|
29
|
-
5. **
|
|
26
|
+
2. **FINAL VARIABLE IS `Result`.** Every measure with VAR/RETURN ends with `VAR Result = ... RETURN Result` (SQLBI convention).
|
|
27
|
+
3. **PASCALCASE FOR VARIABLES.** No underscore prefix. `TotalSales`, not `_TotalSales`.
|
|
28
|
+
4. **`@` PREFIX FOR TEMPORARY COLUMNS.** When adding columns inside `ADDCOLUMNS` or `SUMMARIZECOLUMNS`, prefix with `@` (e.g., `@Rank`, `@Sales`).
|
|
29
|
+
5. **FILTER ON DIMENSIONS.** Never filter directly on fact tables when a dimension exists.
|
|
30
|
+
6. **SAFE DIVISION.** Always use DIVIDE() instead of / operator.
|
|
31
|
+
7. **EXPLAIN CONTEXT.** Help users understand filter vs row context.
|
|
32
|
+
8. **PERFORMANCE FIRST.** Suggest optimizations proactively.
|
|
30
33
|
|
|
31
34
|
---
|
|
32
35
|
|
|
@@ -35,14 +38,26 @@ Best practices for writing and optimizing DAX in Power BI.
|
|
|
35
38
|
|
|
36
39
|
## Naming Conventions
|
|
37
40
|
|
|
41
|
+
Conventions follow the SQLBI Style Guide. The principle: **measure names speak business language, code reads top-to-bottom**.
|
|
42
|
+
|
|
38
43
|
| Element | Convention | Example |
|
|
39
44
|
|---------|------------|---------|
|
|
40
|
-
| Measures |
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
45
|
+
| Measures | Auto-explicative, no prefix | `Sales`, `Margin %`, `Sales YTD` |
|
|
46
|
+
| Time intelligence suffix | Space + period | `Sales YTD`, `Sales PY`, `Sales MTD` |
|
|
47
|
+
| Variations | Space + variation + `%` | `Sales YoY %`, `Sales MoM %` |
|
|
48
|
+
| Ratios | Space + `%` | `Margin %`, `Conversion %` |
|
|
49
|
+
| Calculated Columns | Natural name | `Full Date`, `Product Category` |
|
|
50
|
+
| Variables | PascalCase, no prefix | `TotalSales`, `FilteredTable`, `CurrentDate` |
|
|
51
|
+
| Final variable | Always `Result` | `VAR Result = ...` `RETURN Result` |
|
|
52
|
+
| Temporary columns | Prefix `@` | `@Rank`, `@Sales`, `@Delta` |
|
|
53
|
+
| Measure Tables | Prefix `_`, hidden | `_Measures`, `_KPIs` |
|
|
54
|
+
| Debug/Test Measures | `_` prefix, hidden | `_Debug Row Count` |
|
|
55
|
+
|
|
56
|
+
**Anti-patterns:**
|
|
57
|
+
- `Total Sales`, `Sum of Sales` (redundant, the aggregation is implied)
|
|
58
|
+
- `_Result`, `_FilteredTable` (no underscore prefix on variables)
|
|
59
|
+
- `YTD_Sales`, `Sales_YTD` (use space-separated suffix)
|
|
60
|
+
- `MarginPct`, `MarginRatio` (use `Margin %` instead)
|
|
46
61
|
|
|
47
62
|
---
|
|
48
63
|
|
|
@@ -108,25 +123,47 @@ SumViaMeasure = SUMX(Products, [TotalSales]) // [TotalSales] filters to each pr
|
|
|
108
123
|
- Intermediate calculations
|
|
109
124
|
- Debugging complex measures
|
|
110
125
|
|
|
126
|
+
**Conventions (SQLBI Style Guide):**
|
|
127
|
+
- **PascalCase** without underscore prefix
|
|
128
|
+
- **Final variable always `Result`** — clearly marks the measure's output
|
|
129
|
+
- **Temporary columns prefixed with `@`** to distinguish from model columns
|
|
130
|
+
|
|
111
131
|
```dax
|
|
112
|
-
-- Good:
|
|
113
|
-
|
|
114
|
-
VAR
|
|
115
|
-
VAR
|
|
132
|
+
-- Good: PascalCase vars, Result final var
|
|
133
|
+
Sales YoY % =
|
|
134
|
+
VAR CurrentSales = [Sales]
|
|
135
|
+
VAR PriorYearSales =
|
|
116
136
|
CALCULATE(
|
|
117
|
-
[
|
|
137
|
+
[Sales],
|
|
118
138
|
SAMEPERIODLASTYEAR('Date'[Date])
|
|
119
139
|
)
|
|
120
|
-
VAR
|
|
121
|
-
|
|
122
|
-
|
|
140
|
+
VAR Delta = CurrentSales - PriorYearSales
|
|
141
|
+
VAR Result = DIVIDE(Delta, PriorYearSales)
|
|
142
|
+
RETURN Result
|
|
143
|
+
|
|
144
|
+
-- Good: Temporary column with @ prefix
|
|
145
|
+
Top 10 Products Sales =
|
|
146
|
+
VAR RankedProducts =
|
|
147
|
+
ADDCOLUMNS(
|
|
148
|
+
VALUES(Product[Product Name]),
|
|
149
|
+
"@Rank", RANKX(VALUES(Product[Product Name]), [Sales], , DESC)
|
|
150
|
+
)
|
|
151
|
+
VAR Top10 = FILTER(RankedProducts, [@Rank] <= 10)
|
|
152
|
+
VAR Result = SUMX(Top10, [Sales])
|
|
153
|
+
RETURN Result
|
|
123
154
|
|
|
124
155
|
-- Bad: Repeated calculations (slower, harder to read)
|
|
125
|
-
|
|
156
|
+
Sales YoY Bad =
|
|
126
157
|
DIVIDE(
|
|
127
|
-
[
|
|
128
|
-
CALCULATE([
|
|
158
|
+
[Sales] - CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date])),
|
|
159
|
+
CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date]))
|
|
129
160
|
)
|
|
161
|
+
|
|
162
|
+
-- Bad: Underscore prefix on variables (old convention)
|
|
163
|
+
Sales YoY Old =
|
|
164
|
+
VAR _CurrentSales = [Sales]
|
|
165
|
+
VAR _PriorYearSales = CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date]))
|
|
166
|
+
RETURN DIVIDE(_CurrentSales - _PriorYearSales, _PriorYearSales)
|
|
130
167
|
```
|
|
131
168
|
|
|
132
169
|
### Safe Division
|
|
@@ -635,29 +672,30 @@ Running_Total = CALCULATE(...) -- Use measures
|
|
|
635
672
|
## Formatting Standards
|
|
636
673
|
|
|
637
674
|
```dax
|
|
638
|
-
-- Simple measure (one line)
|
|
639
|
-
|
|
675
|
+
-- Simple measure (one line, no VAR/RETURN needed)
|
|
676
|
+
Sales = SUM(Sales[Amount])
|
|
640
677
|
|
|
641
678
|
-- Medium complexity (few lines)
|
|
642
|
-
Margin = DIVIDE([Profit], [Revenue], 0)
|
|
679
|
+
Margin % = DIVIDE([Profit], [Revenue], 0)
|
|
643
680
|
|
|
644
|
-
-- Complex measure (structured with comments)
|
|
645
|
-
|
|
646
|
-
// Purpose:
|
|
647
|
-
VAR
|
|
648
|
-
VAR
|
|
681
|
+
-- Complex measure (structured with comments, Result as final var)
|
|
682
|
+
Sales YoY % =
|
|
683
|
+
// Purpose: Year-over-year change with handling for missing prior year
|
|
684
|
+
VAR CurrentSales = [Sales]
|
|
685
|
+
VAR PriorYearSales =
|
|
649
686
|
CALCULATE(
|
|
650
|
-
[
|
|
687
|
+
[Sales],
|
|
651
688
|
SAMEPERIODLASTYEAR('Date'[Date])
|
|
652
689
|
)
|
|
653
|
-
VAR
|
|
654
|
-
VAR
|
|
655
|
-
|
|
690
|
+
VAR Delta = CurrentSales - PriorYearSales
|
|
691
|
+
VAR HasPriorYear = NOT(ISBLANK(PriorYearSales))
|
|
692
|
+
VAR Result =
|
|
656
693
|
IF(
|
|
657
|
-
|
|
658
|
-
DIVIDE(
|
|
694
|
+
HasPriorYear,
|
|
695
|
+
DIVIDE(Delta, PriorYearSales),
|
|
659
696
|
BLANK()
|
|
660
697
|
)
|
|
698
|
+
RETURN Result
|
|
661
699
|
```
|
|
662
700
|
|
|
663
701
|
---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "dax-doctor"
|
|
3
3
|
description: "Use when the user asks about DAX Doctor Skill, especially phrases like \"debug DAX\", \"wrong result\", \"DAX error\", \"slow measure\", \"context issue\", \"depurar DAX\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/dax-doctor.md instead. -->
|
package/skills/dax-udf/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "dax-udf"
|
|
3
3
|
description: "Use when the user asks about DAX User-Defined Functions (UDFs), especially phrases like \"UDF\", \"DEFINE FUNCTION\", \"DAX Lib\", \"NAMEOF\", \"reusable DAX\", \"VAL parameter\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/dax-udf.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "deployment"
|
|
3
3
|
description: "Use when the user asks about Deployment Skill, especially phrases like \"deploy\", \"CI/CD\", \"ALM\", \"git integration\", \"environment\", \"desplegar\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/deployment.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "excel-formulas"
|
|
3
3
|
description: "Use when the user asks about Excel Formulas Skill, especially phrases like \"Excel formula\", \"XLOOKUP\", \"dynamic array\", \"LET formula\", \"named range\", \"conditional formatting formula\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/excel-formulas.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "fabric-scripts"
|
|
3
3
|
description: "Use when the user asks about Fabric Scripts Skill, especially phrases like \"Fabric scripts\", \"download dataflows\", \"diagnose connection\", \"TMDL sync\", \"scripts de Fabric\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/fabric-scripts.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "fast-standard"
|
|
3
3
|
description: "Use when the user asks about FAST Standard Skill, especially phrases like \"FAST Standard\", \"financial model\", \"spreadsheet modeling best practices\", \"model audit\", \"calculation block\", \"modelo financiero\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/fast-standard.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "governance"
|
|
3
3
|
description: "Use when the user asks about Governance Skill, especially phrases like \"naming convention\", \"governance\", \"documentation standard\", \"display folder\", \"convención de nombres\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/governance.md instead. -->
|
|
@@ -30,57 +30,100 @@ You are a **BI Governance Specialist** who establishes and enforces naming conve
|
|
|
30
30
|
|
|
31
31
|
## Naming Conventions
|
|
32
32
|
|
|
33
|
+
Conventions follow SQLBI Style Guide, Chris Webb, and Microsoft's semantic model best practices. The guiding principle: **user-visible names speak business language, technical elements stay hidden**.
|
|
34
|
+
|
|
33
35
|
### Tables
|
|
34
36
|
|
|
37
|
+
**Rules:**
|
|
38
|
+
1. **No technical prefixes.** Never use `dim`, `fact`, `tbl`, `t_`. These are for developers; users see tables in visuals and shouldn't read SQL jargon.
|
|
39
|
+
2. **Dimensions singular, facts plural.** A dimension describes one entity (`Customer`, `Product`, `Date`). A fact contains many events (`Sales`, `Orders`, `Transactions`).
|
|
40
|
+
3. **Spaces allowed for user-visible tables.** Use natural language: `Purchase Orders`, not `PurchaseOrders` or `PO_Header`.
|
|
41
|
+
4. **Business names, not source names.** Match the language users speak, not the database schema.
|
|
42
|
+
|
|
35
43
|
| Type | Convention | Example | Anti-Pattern |
|
|
36
44
|
|------|-----------|---------|-------------|
|
|
37
|
-
| Dimension | Singular
|
|
38
|
-
| Fact |
|
|
39
|
-
| Bridge | Prefix with `Bridge` | `
|
|
40
|
-
| Measure table | Prefix `_` | `_Measures`, `_KPIs` | `Measures Table
|
|
41
|
-
| Config/Utility | Prefix `_` | `_Parameters`, `_DateConfig` | `Parameters` |
|
|
42
|
-
| Calculated table | Document clearly | `CalendarTable` (with comment) | Unmarked calculated tables |
|
|
45
|
+
| Dimension | Singular, business name | `Customer`, `Product`, `Date` | `Customers`, `DimCustomer`, `tbl_Customer` |
|
|
46
|
+
| Fact | Plural, business name | `Sales`, `Orders`, `Transactions` | `FactSales`, `fct_sales`, `Sale` |
|
|
47
|
+
| Bridge | Prefix with `Bridge` | `Bridge Customer Region` | `CustomerRegion_Bridge` |
|
|
48
|
+
| Measure table | Prefix `_` (hidden) | `_Measures`, `_KPIs` | `Measures Table` |
|
|
49
|
+
| Config/Utility | Prefix `_` (hidden) | `_Parameters`, `_DateConfig` | `Parameters` |
|
|
43
50
|
|
|
44
51
|
### Columns
|
|
45
52
|
|
|
53
|
+
**Rules:**
|
|
54
|
+
1. **Descriptive and readable.** `Order Date`, not `OrdDt`. Spaces allowed.
|
|
55
|
+
2. **Foreign keys hidden with special marker.** Use `CustomerKey` suffix or `_Customer` prefix to sort them together. **Always hide from report view.**
|
|
56
|
+
3. **No abbreviations** except universal ones (`YTD`, `PY`, `MTD`, `QTD`, `YoY`). Avoid `Qty`, `Amt`, `Vta`, `Cant`.
|
|
57
|
+
4. **Consistency.** If you use spaces in one table, use them everywhere.
|
|
58
|
+
|
|
46
59
|
| Type | Convention | Example |
|
|
47
60
|
|------|-----------|---------|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
| Attribute |
|
|
51
|
-
| Flag/Boolean | `Is[Condition]` | `
|
|
52
|
-
| Amount/Currency |
|
|
53
|
-
| Count |
|
|
54
|
-
| Date |
|
|
61
|
+
| Primary key (surrogate) | `[Table]Key`, hidden | `CustomerKey`, `ProductKey` |
|
|
62
|
+
| Primary key (business) | `[Entity] ID` or `[Entity] Code` | `Customer ID`, `Product Code` |
|
|
63
|
+
| Attribute | Natural language | `First Name`, `Order Date`, `Product Category` |
|
|
64
|
+
| Flag/Boolean | `Is [Condition]` or `Has [Condition]` | `Is Active`, `Has Discount` |
|
|
65
|
+
| Amount/Currency | Include unit in name | `Sales Amount`, `Discount Amount` |
|
|
66
|
+
| Count | Include `Count` suffix | `Order Count`, `Item Count` |
|
|
67
|
+
| Date | Include `Date` suffix | `Order Date`, `Ship Date` |
|
|
55
68
|
|
|
56
69
|
### Measures
|
|
57
70
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
**Rules:**
|
|
72
|
+
1. **Auto-explicative names.** The name alone should tell you what it calculates. No documentation required.
|
|
73
|
+
2. **No redundant prefixes.** Use `Sales`, not `Total Sales`, `Sum of Sales`, or `Amount of Sales`. The aggregation is implied.
|
|
74
|
+
3. **Space-separated suffixes for time intelligence.** `Sales YTD`, `Sales PY`, `Sales YoY %`, `Sales MTD`.
|
|
75
|
+
4. **Space-separated suffixes for ratios and percentages.** `Margin %`, `Growth %`, `Conversion Rate`.
|
|
76
|
+
5. **Never prefix with the table name.** Just `Sales`, not `Transactions[Sales]` in the visible name.
|
|
77
|
+
6. **Explicit measures, hidden source columns.** Create DAX measures for every numeric calculation. Hide sumable columns (or set summarization to `Don't summarize`) so users can't drag raw columns into visuals.
|
|
78
|
+
7. **Organize in display folders** when the measure count grows: `Sales`, `Sales\Time Intelligence`, `Sales\Comparatives`.
|
|
79
|
+
|
|
80
|
+
| Type | Convention | Example | Anti-Pattern |
|
|
81
|
+
|------|-----------|---------|-------------|
|
|
82
|
+
| Base aggregation | Noun, no prefix | `Sales`, `Customers`, `Units Sold` | `Total Sales`, `Sum of Sales`, `Sales Amount Total` |
|
|
83
|
+
| Time intelligence | Noun + period suffix | `Sales YTD`, `Sales PY`, `Sales MTD` | `YTD_Sales`, `Sales_PriorYear` |
|
|
84
|
+
| Variation | Noun + variation + `%` | `Sales YoY %`, `Sales MoM %` | `YoY_Pct_Sales` |
|
|
85
|
+
| Ratio/Percentage | Noun + ` %` | `Margin %`, `Conversion %` | `MarginPct`, `ConversionRatio` |
|
|
86
|
+
| KPI vs target | Noun + vs Target | `Sales vs Target`, `Sales vs Budget %` | `KPI_Sales` |
|
|
87
|
+
| Ranking | `Rank: ` prefix or `Rank` suffix | `Rank: Top Products`, `Product Rank` | `RANK_Products` |
|
|
88
|
+
| Debug/Test | `_` prefix (hidden) | `_Debug Row Count` | `Debug: Row Count` (visible) |
|
|
67
89
|
|
|
68
90
|
### Variables (DAX)
|
|
69
91
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
92
|
+
**Rules:**
|
|
93
|
+
1. **PascalCase.** No underscore prefix. `TotalSales`, `AverageMargin`, `FilteredTable`.
|
|
94
|
+
2. **Final variable always named `Result`.** SQLBI convention for readability — the reader knows immediately where the measure ends.
|
|
95
|
+
3. **Temporary columns prefixed with `@`.** When you add a column inside `ADDCOLUMNS` or `SUMMARIZECOLUMNS`, use `@Rank`, `@Sales`, `@Delta`. Distinguishes them from model columns.
|
|
96
|
+
|
|
97
|
+
```dax
|
|
98
|
+
// Good: PascalCase vars, Result final var, @ for temp columns
|
|
99
|
+
Sales YoY % =
|
|
100
|
+
VAR CurrentSales = [Sales]
|
|
101
|
+
VAR PriorYearSales =
|
|
102
|
+
CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date]))
|
|
103
|
+
VAR Delta = CurrentSales - PriorYearSales
|
|
104
|
+
VAR Result = DIVIDE(Delta, PriorYearSales)
|
|
105
|
+
RETURN Result
|
|
106
|
+
|
|
107
|
+
// Temporary column example
|
|
108
|
+
Top Products =
|
|
109
|
+
VAR RankedProducts =
|
|
110
|
+
ADDCOLUMNS(
|
|
111
|
+
VALUES(Product[Product Name]),
|
|
112
|
+
"@Rank", RANKX(VALUES(Product[Product Name]), [Sales], , DESC)
|
|
113
|
+
)
|
|
114
|
+
VAR Result =
|
|
115
|
+
FILTER(RankedProducts, [@Rank] <= 10)
|
|
116
|
+
RETURN Result
|
|
117
|
+
```
|
|
75
118
|
|
|
76
119
|
### Power Query
|
|
77
120
|
|
|
78
121
|
| Element | Convention | Example |
|
|
79
122
|
|---------|-----------|---------|
|
|
80
|
-
| Query name |
|
|
81
|
-
| Staging query | Prefix
|
|
82
|
-
| Helper function | Prefix
|
|
83
|
-
| Parameter | Prefix
|
|
123
|
+
| Query name | Matches destination table | `Customer`, `Sales` |
|
|
124
|
+
| Staging query | Prefix `stg `, hidden | `stg Customer Raw` |
|
|
125
|
+
| Helper function | Prefix `fn` | `fnCleanText`, `fnGetFiscalYear` |
|
|
126
|
+
| Parameter | Prefix `prm` | `prmServerName`, `prmStartDate` |
|
|
84
127
|
| Step names | Descriptive, PascalCase | `FilteredActiveRows`, `RenamedColumns` |
|
|
85
128
|
|
|
86
129
|
---
|
|
@@ -89,26 +132,28 @@ You are a **BI Governance Specialist** who establishes and enforces naming conve
|
|
|
89
132
|
|
|
90
133
|
### Recommended Folder Structure
|
|
91
134
|
|
|
135
|
+
Display folders separate measures with `\` (backslash). Use them as soon as you have more than ~10 measures.
|
|
136
|
+
|
|
92
137
|
```
|
|
93
138
|
_Measures/
|
|
94
|
-
├── 📁 Core
|
|
95
|
-
│ ├──
|
|
96
|
-
│ ├──
|
|
97
|
-
│ └──
|
|
139
|
+
├── 📁 Core
|
|
140
|
+
│ ├── Sales
|
|
141
|
+
│ ├── Cost
|
|
142
|
+
│ └── Gross Margin
|
|
98
143
|
├── 📁 Time Intelligence
|
|
99
|
-
│ ├──
|
|
100
|
-
│ ├──
|
|
101
|
-
│ └──
|
|
102
|
-
├── 📁
|
|
103
|
-
│ ├──
|
|
104
|
-
│ ├──
|
|
105
|
-
│ └──
|
|
144
|
+
│ ├── Sales YTD
|
|
145
|
+
│ ├── Sales PY
|
|
146
|
+
│ └── Sales YoY %
|
|
147
|
+
├── 📁 Targets
|
|
148
|
+
│ ├── Sales Target
|
|
149
|
+
│ ├── Sales vs Target
|
|
150
|
+
│ └── Sales vs Target %
|
|
106
151
|
├── 📁 Rankings
|
|
107
|
-
│ ├──
|
|
108
|
-
│ └──
|
|
152
|
+
│ ├── Rank: Top Products
|
|
153
|
+
│ └── Rank: Top Customers
|
|
109
154
|
└── 📁 _Debug (hidden in production)
|
|
110
|
-
├──
|
|
111
|
-
└──
|
|
155
|
+
├── _Debug Row Count
|
|
156
|
+
└── _Test Sales
|
|
112
157
|
```
|
|
113
158
|
|
|
114
159
|
---
|
|
@@ -147,11 +192,13 @@ Every model should have:
|
|
|
147
192
|
### Measure Documentation Template
|
|
148
193
|
|
|
149
194
|
```dax
|
|
150
|
-
// Description: Calculates
|
|
195
|
+
// Description: Calculates sales for the current year to date
|
|
151
196
|
// Business rule: Includes all confirmed and shipped orders, excludes cancelled
|
|
152
197
|
// Owner: [team/person]
|
|
153
198
|
// Last modified: [date]
|
|
154
|
-
|
|
199
|
+
Sales YTD =
|
|
200
|
+
VAR Result = TOTALYTD([Sales], 'Date'[Date])
|
|
201
|
+
RETURN Result
|
|
155
202
|
```
|
|
156
203
|
|
|
157
204
|
---
|
|
@@ -173,11 +220,17 @@ TotalSales_YTD = TOTALYTD([TotalSales], 'Date'[Date])
|
|
|
173
220
|
### Code Review Checklist
|
|
174
221
|
|
|
175
222
|
- [ ] Measures use VAR/RETURN for repeated calculations
|
|
223
|
+
- [ ] Final variable in every measure is named `Result`
|
|
224
|
+
- [ ] Variables use PascalCase (no underscore prefix)
|
|
225
|
+
- [ ] Temporary columns use `@` prefix (e.g., `@Rank`)
|
|
176
226
|
- [ ] DIVIDE() used instead of / operator
|
|
177
227
|
- [ ] No FILTER on fact tables (use dimension filters)
|
|
178
|
-
- [ ] Variables follow naming conventions
|
|
179
228
|
- [ ] Complex measures have comments
|
|
180
229
|
- [ ] No hardcoded values (use parameters)
|
|
230
|
+
- [ ] No technical prefixes on tables (`Dim_`, `Fact_`)
|
|
231
|
+
- [ ] Foreign keys hidden from report view
|
|
232
|
+
- [ ] Sumable source columns hidden (only explicit measures visible)
|
|
233
|
+
- [ ] Measure names are auto-explicative (no `Total`, `Sum of`)
|
|
181
234
|
|
|
182
235
|
---
|
|
183
236
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "migration-assistant"
|
|
3
3
|
description: "Use when the user asks about Migration Assistant Skill, especially phrases like \"migrate\", \"move to Fabric\", \"Desktop to PBIP\", \"deprecated feature\", \"migrar\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/migration-assistant.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "model-documenter"
|
|
3
3
|
description: "Use when the user asks about Model Documenter Skill, especially phrases like \"document model\", \"document measures\", \"generate documentation\", \"describe tables\", \"documentar modelo\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/model-documenter.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "pbi-connect"
|
|
3
3
|
description: "Use when the user asks about Power BI MCP Connection Skill, especially phrases like \"connect Power BI\", \"modeling mcp\", \"Power BI Desktop\", \"conectar Power BI\", \"can't connect to Power BI\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/pbi-connect.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "power-query"
|
|
3
3
|
description: "Use when the user asks about Power Query Skill, especially phrases like \"Power Query\", \"query folding\", \"ETL\", \"source connection\", \"refresh\", \"parameters\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/power-query.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "query-performance"
|
|
3
3
|
description: "Use when the user asks about Query Performance Skill, especially phrases like \"slow\", \"DAX Studio\", \"taking too long\", \"reduce refresh time\", \"rendimiento\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/query-performance.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "report-design"
|
|
3
3
|
description: "Use when the user asks about Report Design Skill, especially phrases like \"report design\", \"chart type\", \"IBCS\", \"accessibility\", \"mobile layout\", \"diseño de reporte\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/report-design.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "report-layout"
|
|
3
3
|
description: "Use when the user asks about Report Layout Skill, especially phrases like \"report layout\", \"visual placement\", \"report wireframe\", \"navigation design\", \"diseño de reporte\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/report-layout.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "rls-design"
|
|
3
3
|
description: "Use when the user asks about RLS Design Skill, especially phrases like \"RLS\", \"user can only see their data\", \"restrict access\", \"security role\", \"seguridad a nivel de fila\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/rls-design.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "semantic-model"
|
|
3
3
|
description: "Use when the user asks about Semantic Model Skill, especially phrases like \"semantic model\", \"TMDL\", \"DirectLake\", \"calculation group\", \"storage mode\", \"modelo semántico\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/semantic-model.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "testing-validation"
|
|
3
3
|
description: "Use when the user asks about Testing & Validation Skill, especially phrases like \"test\", \"unit test DAX\", \"regression test\", \"deployment checklist\", \"data reconciliation\", \"pruebas\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/testing-validation.md instead. -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "theme-tweaker"
|
|
3
3
|
description: "Use when the user asks about Theme Tweaker Skill, especially phrases like \"modificar tema\", \"cambiar colores Power BI\", \"personalizar tema\", \"ajustar estilo\", \"theme tweaker\"."
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.1.1"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- Generated by BI Agent Superpowers. Edit src/content/skills/theme-tweaker.md instead. -->
|
|
@@ -42,6 +42,19 @@
|
|
|
42
42
|
"POWERBI_MODELING_MCP_PATH",
|
|
43
43
|
"PBI_MODELING_MCP_PATH"
|
|
44
44
|
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "microsoft-learn",
|
|
48
|
+
"displayName": "Microsoft Learn MCP",
|
|
49
|
+
"source": "http",
|
|
50
|
+
"url": "https://learn.microsoft.com/api/mcp",
|
|
51
|
+
"docs": "https://learn.microsoft.com/en-us/training/support/mcp",
|
|
52
|
+
"requiresAuth": false,
|
|
53
|
+
"platforms": ["win32", "darwin", "linux"],
|
|
54
|
+
"config": {
|
|
55
|
+
"type": "http",
|
|
56
|
+
"url": "https://learn.microsoft.com/api/mcp"
|
|
57
|
+
}
|
|
45
58
|
}
|
|
46
59
|
],
|
|
47
60
|
"toolConfigs": {
|