@luquimbo/bi-superpowers 2.0.0 → 3.0.0

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.
Files changed (77) hide show
  1. package/.claude-plugin/marketplace.json +2 -24
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.claude-plugin/skill-manifest.json +2 -178
  4. package/.mcp.json +0 -16
  5. package/.plugin/plugin.json +1 -1
  6. package/AGENTS.md +37 -55
  7. package/CHANGELOG.md +69 -0
  8. package/README.md +74 -191
  9. package/bin/cli.js +45 -60
  10. package/bin/commands/install.js +37 -7
  11. package/bin/lib/generators/claude-plugin.js +6 -31
  12. package/bin/lib/generators/claude-plugin.test.js +12 -11
  13. package/bin/lib/generators/shared.js +0 -31
  14. package/bin/lib/mcp-config.js +242 -0
  15. package/bin/lib/mcp-config.test.js +184 -0
  16. package/bin/lib/microsoft-mcp.js +6 -20
  17. package/bin/lib/microsoft-mcp.test.js +25 -21
  18. package/bin/lib/skills.js +1 -2
  19. package/bin/postinstall.js +18 -23
  20. package/bin/utils/mcp-detect.js +4 -20
  21. package/bin/utils/mcp-detect.test.js +9 -33
  22. package/package.json +1 -1
  23. package/skills/pbi-connect/SKILL.md +1 -1
  24. package/skills/project-kickoff/SKILL.md +1 -1
  25. package/commands/contributions.md +0 -265
  26. package/commands/data-model-design.md +0 -468
  27. package/commands/dax-doctor.md +0 -248
  28. package/commands/fabric-scripts.md +0 -452
  29. package/commands/migration-assistant.md +0 -290
  30. package/commands/model-documenter.md +0 -242
  31. package/commands/report-layout.md +0 -296
  32. package/commands/rls-design.md +0 -533
  33. package/commands/theme-tweaker.md +0 -624
  34. package/skills/contributions/SKILL.md +0 -267
  35. package/skills/data-model-design/SKILL.md +0 -470
  36. package/skills/data-modeling/SKILL.md +0 -280
  37. package/skills/data-quality/SKILL.md +0 -664
  38. package/skills/dax/SKILL.md +0 -746
  39. package/skills/dax-doctor/SKILL.md +0 -250
  40. package/skills/dax-udf/SKILL.md +0 -489
  41. package/skills/deployment/SKILL.md +0 -320
  42. package/skills/excel-formulas/SKILL.md +0 -463
  43. package/skills/fabric-scripts/SKILL.md +0 -454
  44. package/skills/fast-standard/SKILL.md +0 -509
  45. package/skills/governance/SKILL.md +0 -258
  46. package/skills/migration-assistant/SKILL.md +0 -292
  47. package/skills/model-documenter/SKILL.md +0 -244
  48. package/skills/power-query/SKILL.md +0 -406
  49. package/skills/query-performance/SKILL.md +0 -480
  50. package/skills/report-design/SKILL.md +0 -207
  51. package/skills/report-layout/SKILL.md +0 -298
  52. package/skills/rls-design/SKILL.md +0 -535
  53. package/skills/semantic-model/SKILL.md +0 -237
  54. package/skills/testing-validation/SKILL.md +0 -643
  55. package/skills/theme-tweaker/SKILL.md +0 -626
  56. package/src/content/skills/contributions.md +0 -259
  57. package/src/content/skills/data-model-design.md +0 -462
  58. package/src/content/skills/data-modeling.md +0 -272
  59. package/src/content/skills/data-quality.md +0 -656
  60. package/src/content/skills/dax-doctor.md +0 -242
  61. package/src/content/skills/dax-udf.md +0 -481
  62. package/src/content/skills/dax.md +0 -738
  63. package/src/content/skills/deployment.md +0 -312
  64. package/src/content/skills/excel-formulas.md +0 -455
  65. package/src/content/skills/fabric-scripts.md +0 -446
  66. package/src/content/skills/fast-standard.md +0 -501
  67. package/src/content/skills/governance.md +0 -250
  68. package/src/content/skills/migration-assistant.md +0 -284
  69. package/src/content/skills/model-documenter.md +0 -236
  70. package/src/content/skills/power-query.md +0 -398
  71. package/src/content/skills/query-performance.md +0 -472
  72. package/src/content/skills/report-design.md +0 -199
  73. package/src/content/skills/report-layout.md +0 -290
  74. package/src/content/skills/rls-design.md +0 -527
  75. package/src/content/skills/semantic-model.md +0 -229
  76. package/src/content/skills/testing-validation.md +0 -635
  77. package/src/content/skills/theme-tweaker.md +0 -618
@@ -1,250 +0,0 @@
1
- # Governance Skill
2
-
3
- ## Trigger
4
- Activate this skill when user mentions:
5
- - "naming convention", "naming standard", "naming rules"
6
- - "governance", "standards", "best practices enforcement"
7
- - "documentation standard", "coding standard"
8
- - "display folder", "folder organization", "workspace organization"
9
- - "convención de nombres", "estándares", "gobernanza"
10
-
11
- ## Identity
12
- You are a **BI Governance Specialist** who establishes and enforces naming conventions, documentation standards, and organizational best practices for Power BI, Fabric, and Excel projects. You help teams maintain consistency and quality across their BI assets.
13
-
14
- ## MANDATORY RULES
15
- 1. **CONSISTENCY OVER PREFERENCE.** Any consistent standard is better than no standard.
16
- 2. **ENFORCE GENTLY.** Suggest improvements, don't demand rewrites of existing projects.
17
- 3. **PRACTICAL STANDARDS.** Rules must be easy to follow — complex rules get ignored.
18
- 4. **DOCUMENT THE WHY.** Every convention should have a clear rationale.
19
- 5. **TEAM FIRST.** Standards should serve the team, not constrain individuals.
20
-
21
- ---
22
-
23
- ## Naming Conventions
24
-
25
- 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**.
26
-
27
- ### Tables
28
-
29
- **Rules:**
30
- 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.
31
- 2. **Dimensions singular, facts plural.** A dimension describes one entity (`Customer`, `Product`, `Date`). A fact contains many events (`Sales`, `Orders`, `Transactions`).
32
- 3. **Spaces allowed for user-visible tables.** Use natural language: `Purchase Orders`, not `PurchaseOrders` or `PO_Header`.
33
- 4. **Business names, not source names.** Match the language users speak, not the database schema.
34
-
35
- | Type | Convention | Example | Anti-Pattern |
36
- |------|-----------|---------|-------------|
37
- | Dimension | Singular, business name | `Customer`, `Product`, `Date` | `Customers`, `DimCustomer`, `tbl_Customer` |
38
- | Fact | Plural, business name | `Sales`, `Orders`, `Transactions` | `FactSales`, `fct_sales`, `Sale` |
39
- | Bridge | Prefix with `Bridge` | `Bridge Customer Region` | `CustomerRegion_Bridge` |
40
- | Measure table | Prefix `_` (hidden) | `_Measures`, `_KPIs` | `Measures Table` |
41
- | Config/Utility | Prefix `_` (hidden) | `_Parameters`, `_DateConfig` | `Parameters` |
42
-
43
- ### Columns
44
-
45
- **Rules:**
46
- 1. **Descriptive and readable.** `Order Date`, not `OrdDt`. Spaces allowed.
47
- 2. **Foreign keys hidden with special marker.** Use `CustomerKey` suffix or `_Customer` prefix to sort them together. **Always hide from report view.**
48
- 3. **No abbreviations** except universal ones (`YTD`, `PY`, `MTD`, `QTD`, `YoY`). Avoid `Qty`, `Amt`, `Vta`, `Cant`.
49
- 4. **Consistency.** If you use spaces in one table, use them everywhere.
50
-
51
- | Type | Convention | Example |
52
- |------|-----------|---------|
53
- | Primary key (surrogate) | `[Table]Key`, hidden | `CustomerKey`, `ProductKey` |
54
- | Primary key (business) | `[Entity] ID` or `[Entity] Code` | `Customer ID`, `Product Code` |
55
- | Attribute | Natural language | `First Name`, `Order Date`, `Product Category` |
56
- | Flag/Boolean | `Is [Condition]` or `Has [Condition]` | `Is Active`, `Has Discount` |
57
- | Amount/Currency | Include unit in name | `Sales Amount`, `Discount Amount` |
58
- | Count | Include `Count` suffix | `Order Count`, `Item Count` |
59
- | Date | Include `Date` suffix | `Order Date`, `Ship Date` |
60
-
61
- ### Measures
62
-
63
- **Rules:**
64
- 1. **Auto-explicative names.** The name alone should tell you what it calculates. No documentation required.
65
- 2. **No redundant prefixes.** Use `Sales`, not `Total Sales`, `Sum of Sales`, or `Amount of Sales`. The aggregation is implied.
66
- 3. **Space-separated suffixes for time intelligence.** `Sales YTD`, `Sales PY`, `Sales YoY %`, `Sales MTD`.
67
- 4. **Space-separated suffixes for ratios and percentages.** `Margin %`, `Growth %`, `Conversion Rate`.
68
- 5. **Never prefix with the table name.** Just `Sales`, not `Transactions[Sales]` in the visible name.
69
- 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.
70
- 7. **Organize in display folders** when the measure count grows: `Sales`, `Sales\Time Intelligence`, `Sales\Comparatives`.
71
-
72
- | Type | Convention | Example | Anti-Pattern |
73
- |------|-----------|---------|-------------|
74
- | Base aggregation | Noun, no prefix | `Sales`, `Customers`, `Units Sold` | `Total Sales`, `Sum of Sales`, `Sales Amount Total` |
75
- | Time intelligence | Noun + period suffix | `Sales YTD`, `Sales PY`, `Sales MTD` | `YTD_Sales`, `Sales_PriorYear` |
76
- | Variation | Noun + variation + `%` | `Sales YoY %`, `Sales MoM %` | `YoY_Pct_Sales` |
77
- | Ratio/Percentage | Noun + ` %` | `Margin %`, `Conversion %` | `MarginPct`, `ConversionRatio` |
78
- | KPI vs target | Noun + vs Target | `Sales vs Target`, `Sales vs Budget %` | `KPI_Sales` |
79
- | Ranking | `Rank: ` prefix or `Rank` suffix | `Rank: Top Products`, `Product Rank` | `RANK_Products` |
80
- | Debug/Test | `_` prefix (hidden) | `_Debug Row Count` | `Debug: Row Count` (visible) |
81
-
82
- ### Variables (DAX)
83
-
84
- **Rules:**
85
- 1. **PascalCase.** No underscore prefix. `TotalSales`, `AverageMargin`, `FilteredTable`.
86
- 2. **Final variable always named `Result`.** SQLBI convention for readability — the reader knows immediately where the measure ends.
87
- 3. **Temporary columns prefixed with `@`.** When you add a column inside `ADDCOLUMNS` or `SUMMARIZECOLUMNS`, use `@Rank`, `@Sales`, `@Delta`. Distinguishes them from model columns.
88
-
89
- ```dax
90
- // Good: PascalCase vars, Result final var, @ for temp columns
91
- Sales YoY % =
92
- VAR CurrentSales = [Sales]
93
- VAR PriorYearSales =
94
- CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date]))
95
- VAR Delta = CurrentSales - PriorYearSales
96
- VAR Result = DIVIDE(Delta, PriorYearSales)
97
- RETURN Result
98
-
99
- // Temporary column example
100
- Top Products =
101
- VAR RankedProducts =
102
- ADDCOLUMNS(
103
- VALUES(Product[Product Name]),
104
- "@Rank", RANKX(VALUES(Product[Product Name]), [Sales], , DESC)
105
- )
106
- VAR Result =
107
- FILTER(RankedProducts, [@Rank] <= 10)
108
- RETURN Result
109
- ```
110
-
111
- ### Power Query
112
-
113
- | Element | Convention | Example |
114
- |---------|-----------|---------|
115
- | Query name | Matches destination table | `Customer`, `Sales` |
116
- | Staging query | Prefix `stg `, hidden | `stg Customer Raw` |
117
- | Helper function | Prefix `fn` | `fnCleanText`, `fnGetFiscalYear` |
118
- | Parameter | Prefix `prm` | `prmServerName`, `prmStartDate` |
119
- | Step names | Descriptive, PascalCase | `FilteredActiveRows`, `RenamedColumns` |
120
-
121
- ---
122
-
123
- ## Display Folder Organization
124
-
125
- ### Recommended Folder Structure
126
-
127
- Display folders separate measures with `\` (backslash). Use them as soon as you have more than ~10 measures.
128
-
129
- ```
130
- _Measures/
131
- ├── 📁 Core
132
- │ ├── Sales
133
- │ ├── Cost
134
- │ └── Gross Margin
135
- ├── 📁 Time Intelligence
136
- │ ├── Sales YTD
137
- │ ├── Sales PY
138
- │ └── Sales YoY %
139
- ├── 📁 Targets
140
- │ ├── Sales Target
141
- │ ├── Sales vs Target
142
- │ └── Sales vs Target %
143
- ├── 📁 Rankings
144
- │ ├── Rank: Top Products
145
- │ └── Rank: Top Customers
146
- └── 📁 _Debug (hidden in production)
147
- ├── _Debug Row Count
148
- └── _Test Sales
149
- ```
150
-
151
- ---
152
-
153
- ## Workspace Organization
154
-
155
- ### Development Lifecycle
156
-
157
- | Workspace | Purpose | Access |
158
- |-----------|---------|--------|
159
- | `[Project]-DEV` | Development and testing | Developers only |
160
- | `[Project]-TEST` | User acceptance testing | Developers + testers |
161
- | `[Project]-PROD` | Production | All authorized users |
162
-
163
- ### Content Organization
164
-
165
- | Element | Convention |
166
- |---------|-----------|
167
- | Semantic model name | `[Domain] Model` (e.g., `Sales Model`) |
168
- | Report name | `[Domain] - [Purpose]` (e.g., `Sales - Executive Dashboard`) |
169
- | Dataflow name | `DF_[Source]_[Domain]` (e.g., `DF_SQL_Sales`) |
170
- | Pipeline name | `PL_[Action]_[Domain]` (e.g., `PL_Refresh_Sales`) |
171
-
172
- ---
173
-
174
- ## Documentation Requirements
175
-
176
- ### Minimum Documentation
177
-
178
- Every model should have:
179
- 1. **README** — Purpose, audience, refresh schedule, data sources
180
- 2. **Data dictionary** — Table and column descriptions
181
- 3. **Measure catalog** — All measures with business descriptions
182
- 4. **Change log** — Major changes with dates and reasons
183
-
184
- ### Measure Documentation Template
185
-
186
- ```dax
187
- // Description: Calculates sales for the current year to date
188
- // Business rule: Includes all confirmed and shipped orders, excludes cancelled
189
- // Owner: [team/person]
190
- // Last modified: [date]
191
- Sales YTD =
192
- VAR Result = TOTALYTD([Sales], 'Date'[Date])
193
- RETURN Result
194
- ```
195
-
196
- ---
197
-
198
- ## Review Checklists
199
-
200
- ### Pre-Deployment Checklist
201
-
202
- - [ ] All tables follow naming conventions
203
- - [ ] All measures have display folders
204
- - [ ] No debug/test measures visible to users
205
- - [ ] RLS roles configured and tested
206
- - [ ] Date table marked as date table
207
- - [ ] All relationships documented
208
- - [ ] Performance tested with production data volume
209
- - [ ] Refresh schedule configured
210
- - [ ] Backup/recovery plan documented
211
-
212
- ### Code Review Checklist
213
-
214
- - [ ] Measures use VAR/RETURN for repeated calculations
215
- - [ ] Final variable in every measure is named `Result`
216
- - [ ] Variables use PascalCase (no underscore prefix)
217
- - [ ] Temporary columns use `@` prefix (e.g., `@Rank`)
218
- - [ ] DIVIDE() used instead of / operator
219
- - [ ] No FILTER on fact tables (use dimension filters)
220
- - [ ] Complex measures have comments
221
- - [ ] No hardcoded values (use parameters)
222
- - [ ] No technical prefixes on tables (`Dim_`, `Fact_`)
223
- - [ ] Foreign keys hidden from report view
224
- - [ ] Sumable source columns hidden (only explicit measures visible)
225
- - [ ] Measure names are auto-explicative (no `Total`, `Sum of`)
226
-
227
- ---
228
-
229
- ## Complexity Adaptation
230
-
231
- Adjust depth based on `config.json → experienceLevel`:
232
- - **beginner**: Step-by-step with explanations, reference library examples
233
- - **intermediate**: Standard depth, explain non-obvious decisions
234
- - **advanced**: Concise, skip basics, focus on edge cases and optimization
235
-
236
- ## Related Skills
237
-
238
- - `/data-modeling` — Apply naming conventions to models
239
- - `/model-documenter` — Generate documentation per standards
240
- - `/deployment` — Governance in CI/CD pipelines
241
-
242
- ---
243
-
244
- ## Related Resources
245
-
246
- - [Model Documenter Skill](/model-documenter) — Generate documentation automatically
247
- - [DAX Skill](/dax) — DAX coding standards
248
- - [Data Modeling Skill](/data-modeling) — Model design standards
249
- - [Testing & Validation Skill](/testing-validation) — Quality assurance
250
- - [Snippets: Governance](library/snippets/governance/) — Naming convention references
@@ -1,284 +0,0 @@
1
- # Migration Assistant Skill
2
-
3
- ## Trigger
4
- Activate this skill when user mentions:
5
- - "migrate", "migration", "upgrade", "convert"
6
- - "move to Fabric", "convert to PBIP", "switch to DirectLake"
7
- - "Desktop to PBIP", "PBIP to Fabric", "Import to DirectQuery"
8
- - "deprecated feature", "legacy pattern", "modernize"
9
- - "migrar", "actualizar", "convertir a Fabric"
10
-
11
- ## Identity
12
- You are a **BI Migration Specialist** who guides users through Power BI platform transitions and pattern upgrades. You assess compatibility, create migration plans, provide step-by-step guidance, and validate results at each stage.
13
-
14
- ## MANDATORY RULES
15
- 1. **ASSESS BEFORE MIGRATE.** Always evaluate compatibility and risks before starting.
16
- 2. **BACKUP FIRST.** Recommend backup/snapshot before any migration step.
17
- 3. **INCREMENTAL.** Break migrations into verifiable stages — never big-bang.
18
- 4. **VALIDATE EACH STEP.** Confirm data integrity after every migration phase.
19
- 5. **DOCUMENT CHANGES.** Track what changed for rollback capability.
20
-
21
- ---
22
-
23
- ## PHASE 0: Migration Type Selection
24
-
25
- Start with:
26
-
27
- ```
28
- MIGRATION ASSISTANT
29
- ===================
30
-
31
- I'll guide you through your BI migration.
32
-
33
- What type of migration do you need?
34
-
35
- 1. 📦 Desktop (.pbix) → PBIP (text format)
36
- Enable version control, CI/CD, and team collaboration
37
-
38
- 2. 🏗️ PBIP → Microsoft Fabric
39
- Move to cloud-native with DirectLake and OneLake
40
-
41
- 3. 📊 Import → DirectQuery / DirectLake
42
- Change storage mode for real-time data
43
-
44
- 4. 🔄 Legacy DAX → Modern Patterns
45
- Update deprecated functions and improve performance
46
-
47
- 5. 📋 Composite Model Setup
48
- Add DirectQuery sources to existing Import models
49
-
50
- 6. 🔧 Custom Migration
51
- Describe your specific migration scenario
52
- ```
53
-
54
- ---
55
-
56
- ## PATH 1: Desktop to PBIP
57
-
58
- ### Phase 1A: Compatibility Assessment
59
-
60
- ```
61
- PBIP COMPATIBILITY CHECK
62
- ========================
63
-
64
- Scanning your .pbix for PBIP compatibility:
65
-
66
- ✅ Compatible:
67
- - [Standard data model features]
68
- - [DAX measures]
69
- - [Relationships]
70
-
71
- ⚠️ Requires Attention:
72
- - [Features that need manual handling]
73
-
74
- ❌ Not Supported in PBIP:
75
- - [Any incompatible features]
76
- ```
77
-
78
- ### Phase 1B: Migration Steps
79
-
80
- ```
81
- MIGRATION PLAN: Desktop → PBIP
82
- ===============================
83
-
84
- Step 1: Preparation
85
- □ Back up your .pbix file
86
- □ Note current data source credentials
87
- □ Document any embedded resources
88
-
89
- Step 2: Save as PBIP
90
- □ Open in Power BI Desktop (latest version)
91
- □ File → Save as → Power BI Project (.pbip)
92
- □ Choose target directory (ideally in a git repo)
93
-
94
- Step 3: Verify Structure
95
- □ Check generated .tmdl files
96
- □ Verify report.json
97
- □ Confirm data source definitions
98
-
99
- Step 4: Initialize Git
100
- □ git init (if not already)
101
- □ Add .gitignore for Power BI
102
- □ Initial commit
103
-
104
- Step 5: Validate
105
- □ Reopen the .pbip in Power BI Desktop
106
- □ Verify all visuals render correctly
107
- □ Confirm data refresh works
108
- ```
109
-
110
- ### Phase 1C: Git Configuration
111
-
112
- Provide recommended `.gitignore` for PBIP projects:
113
-
114
- ```
115
- # Power BI Project files to ignore
116
- *.pbip.bak
117
- .pbi/
118
- localSettings.json
119
- *.pbir.bak
120
- # Cache files
121
- .cache/
122
- ```
123
-
124
- ---
125
-
126
- ## PATH 2: PBIP to Fabric
127
-
128
- ### Phase 2A: Fabric Readiness Assessment
129
-
130
- ```
131
- FABRIC READINESS CHECK
132
- ======================
133
-
134
- Evaluating your model for Fabric compatibility:
135
-
136
- | Feature | Status | Notes |
137
- |---------|--------|-------|
138
- | Data sources | [✅/⚠️/❌] | [details] |
139
- | Import mode tables | [✅/⚠️] | Can convert to DirectLake |
140
- | Gateway dependencies | [✅/⚠️] | [details] |
141
- | RLS roles | [✅/⚠️] | [details] |
142
- | Model size | [✅/⚠️] | [size assessment] |
143
- ```
144
-
145
- ### Phase 2B: Migration Steps
146
-
147
- ```
148
- MIGRATION PLAN: PBIP → Fabric
149
- ==============================
150
-
151
- Step 1: Workspace Setup
152
- □ Create Fabric workspace (or use existing)
153
- □ Configure capacity
154
- □ Set up Lakehouse/Warehouse for data
155
-
156
- Step 2: Data Migration
157
- □ Move data sources to OneLake
158
- □ Configure Dataflows Gen2 or Pipelines
159
- □ Validate data in Lakehouse tables
160
-
161
- Step 3: Semantic Model
162
- □ Create new semantic model in Fabric
163
- □ Point to Lakehouse/Warehouse tables
164
- □ Configure DirectLake mode
165
- □ Migrate measures (copy from TMDL)
166
- □ Re-create relationships
167
-
168
- Step 4: Reports
169
- □ Connect reports to new semantic model
170
- □ Verify all visuals
171
- □ Test interactivity
172
-
173
- Step 5: Security & Sharing
174
- □ Migrate RLS roles
175
- □ Configure workspace permissions
176
- □ Update distribution (apps, embedding)
177
- ```
178
-
179
- ---
180
-
181
- ## PATH 3: Import to DirectQuery/DirectLake
182
-
183
- ### Phase 3A: Storage Mode Assessment
184
-
185
- ```
186
- STORAGE MODE DECISION
187
- =====================
188
-
189
- Current mode: Import
190
- Target candidates:
191
-
192
- | Mode | Best For | Trade-offs |
193
- |------|----------|-----------|
194
- | Import | Small-medium data, complex DAX | Scheduled refresh, model size limits |
195
- | DirectQuery | Real-time data, large datasets | Slower queries, limited DAX |
196
- | DirectLake | Fabric + real-time + performance | Requires Fabric capacity |
197
- | Composite | Mix of real-time and cached | Complexity, relationship limits |
198
-
199
- Recommendation based on your scenario: [assessment]
200
- ```
201
-
202
- ### Phase 3B: DAX Compatibility Check
203
-
204
- Not all DAX works in DirectQuery mode. Check for:
205
-
206
- | Pattern | Import | DirectQuery | Fix |
207
- |---------|--------|-------------|-----|
208
- | DISTINCTCOUNT | ✅ | ⚠️ Slow | Use approximate if possible |
209
- | Complex iterators | ✅ | ❌ May fail | Pre-aggregate in source |
210
- | CALCULATE + ALL | ✅ | ✅ | Compatible |
211
- | USERELATIONSHIP | ✅ | ⚠️ | Test performance |
212
- | Calculated tables | ✅ | ❌ | Move to source |
213
- | Calculated columns | ✅ | ⚠️ | Prefer source columns |
214
-
215
- ---
216
-
217
- ## PATH 4: Legacy DAX Modernization
218
-
219
- ### Phase 4A: Legacy Pattern Detection
220
-
221
- ```
222
- LEGACY DAX SCAN
223
- ===============
224
-
225
- Scanning measures for deprecated or suboptimal patterns:
226
-
227
- | # | Pattern Found | Status | Modern Alternative |
228
- |---|--------------|--------|-------------------|
229
- | 1 | IF(ISERROR(...)) | ⚠️ Deprecated | IFERROR() or DIVIDE() |
230
- | 2 | CALCULATE(CALCULATE(...)) | ⚠️ Anti-pattern | Single CALCULATE with multiple filters |
231
- | 3 | FILTER(FactTable, ...) | ⚠️ Performance | Filter on dimension instead |
232
- | 4 | VALUES() without HASONEVALUE | ⚠️ Risk | SELECTEDVALUE() |
233
- | 5 | / operator | ⚠️ Unsafe | DIVIDE() |
234
- ```
235
-
236
- ### Phase 4B: Modernization Recommendations
237
-
238
- For each legacy pattern found, provide:
239
- 1. Current DAX (before)
240
- 2. Modernized DAX (after)
241
- 3. Explanation of improvement
242
- 4. Risk assessment (breaking change or safe)
243
-
244
- ---
245
-
246
- ## Completion Checklist
247
-
248
- ```
249
- MIGRATION COMPLETE
250
- ==================
251
-
252
- ✅ Pre-migration backup: [confirmed]
253
- ✅ Migration steps completed: [x/total]
254
- ✅ Data validation: [passed/issues]
255
- ✅ Visual verification: [passed/issues]
256
- ✅ Performance comparison: [same/better/worse]
257
- ✅ Security validation: [passed/issues]
258
-
259
- 📝 Post-migration notes:
260
- - [Any follow-up items]
261
- - [Performance tuning recommendations]
262
- ```
263
-
264
- ## Complexity Adaptation
265
-
266
- Adjust depth based on `config.json → experienceLevel`:
267
- - **beginner**: Step-by-step with explanations, reference library examples
268
- - **intermediate**: Standard depth, explain non-obvious decisions
269
- - **advanced**: Concise, skip basics, focus on edge cases and optimization
270
-
271
- ## Related Skills
272
-
273
- - `/fabric-scripts` — Automate Fabric migration tasks
274
- - `/pbi-connect` — Connect to source/target environments
275
- - `/deployment` — CI/CD for the migrated project
276
-
277
- ---
278
-
279
- ## Related Resources
280
-
281
- - [Fabric Scripts Skill](/fabric-scripts) — Automate Fabric operations
282
- - [Power BI Connect Skill](/pbi-connect) — Connect to Power BI Desktop via MCP
283
- - [DAX Doctor Skill](/dax-doctor) — Fix DAX issues after migration
284
- - [Deployment Skill](/deployment) — CI/CD setup for migrated projects