A production-ready GitHub Copilot Skill ecosystem for analyzing and optimizing Power BI reports, semantic models, and DAX formulas with comprehensive Import vs DirectQuery guidance.
The Power BI Optimization Skill is a comprehensive GitHub Copilot skill ecosystem providing expert-level analysis and optimization guidance for Power BI developers and analysts.
- π― Hub-and-Spoke Architecture: Intelligent triage + deep specialist expertise
- π Storage Mode Expertise: Comprehensive Import, DirectQuery, and Composite model guidance
- π 5 Production-Ready Specialists: 47+ optimization patterns across all Power BI domains
- β‘ Real Performance Metrics: Before/after measurements with actual numbers
- β Battle-Tested Patterns: Production-ready implementations with checklists
- π€ Built-in BPA Analysis: Analyze models directly without external tools (~30 BPA rules integrated)
- π Performance Analyzer Integration: Analyze query timings & bottlenecks from built-in Power BI tool
- π¬ Benchmark Analysis Support: Statistical performance testing with min/max/avg, A/B testing, variance analysis
- π MCP Automation: Fully automated DAX optimization with real benchmarking - 94% time savings!
π― Hub Skill
(@powerbi-optimization)
Comprehensive Analysis
Intelligent Triage
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
βΌ βΌ βΌ
π¬ Specialist π¬ Specialist π¬ Specialist
Deep Expertise Deep Expertise Deep Expertise
Start broad, go deep when needed.
- GitHub Copilot: Active subscription (individual or business)
- VS Code: Latest version with GitHub Copilot extension
- Power BI Desktop: Recommended for testing (optional)
- PBIP Format: Works best with Power BI Project (.pbip) files
gh skill install PBI-Guy/Power-BI-Optimization-Skill powerbi-optimization --agent github-copilot --scope userUser Scope (available in all workspaces):
# Clone the repository
git clone https://github.com/PBI-Guy/Power-BI-Optimization-Skill.git
# Copy to your user skills directory
# Windows
cp -r Power-BI-Optimization-Skill/skills/powerbi-optimization "$env:USERPROFILE/.github/skills/"
# macOS/Linux
cp -r Power-BI-Optimization-Skill/skills/powerbi-optimization ~/.github/skills/Workspace Scope (current project only):
# Copy to your workspace skills directory
cp -r Power-BI-Optimization-Skill/skills/powerbi-optimization .github/skills/After installation, verify the skill is available in GitHub Copilot:
@powerbi-optimization what can you help me with?
The skill automatically activates when you discuss Power BI topics in GitHub Copilot:
- "How can I optimize this DAX measure?"
- "My DirectQuery report is slow"
- "Review my semantic model design"
- "Best practices for row-level security?"
- Multi-layer analysis: DAX, semantic model, report, and Power Query
- Storage mode expertise: Import, DirectQuery, and Composite model patterns
- Prioritized findings: Critical issues flagged first (P0 β P3)
- Impact quantification: Real performance metrics (not just "faster")
- Root cause analysis: Explains WHY issues exist, not just WHAT
- Before/after examples: Clear code comparisons with metrics
- Step-by-step guidance: Production-ready implementations
- Testing strategies: Verification and validation approaches
- Mode-specific checklists: Import vs DirectQuery optimization steps
- Quick wins: High-impact, low-effort improvements
- DAX Mastery: 20+ patterns (iterators, context, calculation groups)
- Model Design: 7 patterns (schema, relationships, storage modes)
- Report Performance: 7 patterns (visuals, UX, interactions)
- Power Query M: 7 patterns (folding, refresh, incremental)
- Security & RLS: 7 patterns (static, dynamic, performance)
- Import Mode: Model size, refresh, performance optimization
- DirectQuery Mode: Query folding (mandatory!), source optimization
- Composite Models: Best-of-both patterns with aggregations
- Real metrics: 10ms vs 200ms, 500ms vs 3s load times
- Decision matrices: When to use each mode
Focus: Advanced DAX formula optimization
Use when:
- Complex formulas (50+ lines, nested logic)
- Iterator performance (SUMX, FILTER, ADDCOLUMNS)
- Context transitions and evaluation context issues
- Calculation groups and dynamic calculations
- Formula engine performance bottlenecks
- Benchmark analysis: Statistical performance testing (min/max/avg/variance), A/B testing, cold vs warm cache
Storage Mode Coverage:
- Import: Full DAX support, storage vs formula engine optimization
- DirectQuery: Function restrictions, query folding requirements, NO calculated columns
- Performance comparison: Simple aggregation (10ms Import vs 200ms DirectQuery)
Triggers: "optimize this DAX", "measure performance", "context transition", "iterator", "benchmark"
Focus: Semantic model architecture and storage optimization
Use when:
- Star vs snowflake schema restructuring
- Complex relationships (many-to-many, bridge tables, role-playing)
- Storage mode decisions (Import vs DirectQuery vs Composite)
- LModels needing optimization
- Incremental refresh strategies
- Data type and column optimization
Storage Mode Coverage:
- Comprehensive comparison table (8 dimensions)
- Import: Model size limits, refresh window, data types
- DirectQuery: Source optimization, connection limits (10 concurrent), cross-source issues
- Composite: 3 patterns (dimensions Import/facts DirectQuery, hot/cold, aggregations)
- Migration strategies between modes
Triggers: "star schema", "storage mode", "many-to-many", "relationship issues"
Focus: Visual optimization and UX design
Use when:
- Slow-rendering visuals or pages
- Too many visuals (7-15 rule)
- Layout and navigation design
- Accessibility compliance (WCAG 2.1)
- Mobile layout optimization
Storage Mode Coverage:
- Import: 500ms-2s page load, instant interactions
- DirectQuery: 3-15s page load (5-10x slower!), query reduction critical
- Visual-specific guidance table (card, table, matrix, map performance by mode)
- DirectQuery: 5-10 visuals max per page, enable query reduction (70% fewer queries)
Triggers: "visual performance", "report layout", "too many visuals", "slow report"
Focus: Data loading and refresh optimization
Use when:
- Slow data refresh issues
- Query folding optimization needed
- M code transformation performance
- Merge and append performance problems
- Refresh timeouts or memory errors
- Incremental loading patterns
Storage Mode Coverage:
- Import: Folding for faster refresh, incremental patterns, parallel loading
- DirectQuery: 100% folding MANDATORY, NO calculated columns, native SQL recommended
- Testing: "View Native Query" verification, Performance Analyzer, SQL Profiler
- DirectQuery anti-patterns: Text operations, merges, complex logic (all break folding)
Triggers: "power query", "slow refresh", "query folding", "m code"
Focus: Row-level security and data protection
Use when:
- RLS implementation and optimization
- Dynamic security patterns (USERNAME, USERPRINCIPALNAME)
- RLS performance problems (can slow 5-10x!)
- Object-level security (OLS) for columns/tables
- Embedding security (app owns data vs user owns data)
- Compliance and data protection
Storage Mode Coverage:
- Import: In-memory enforcement, fast evaluation (10-50% overhead), complex DAX OK
- DirectQuery: Source enforcement, must fold to SQL, DB indexes critical (20-100% overhead)
- Security table patterns by mode
- Testing: "View as role", Performance Analyzer, SQL WHERE clause verification
Triggers: "row level security", "RLS", "data security", "USERNAME", "USERPRINCIPALNAME"
BREAKTHROUGH FEATURE - Say goodbye to manual benchmarking!
@powerbi-optimization "Optimize and benchmark this measure: [DAX code]"
β±οΈ 2-3 minutes later...
β
Analysis complete!
β
3 optimized versions created
β
Benchmarks complete (18 total: 6 runs Γ 3 versions)
β
Winner identified: 94% faster
β
Ready to apply? [Yes/No/Show Code]
When Power BI MCP Server is configured, the skill can:
- Connect to your running Power BI model (in Power BI Desktop)
- Create temporary measures for each optimization variant
- Benchmark each version (5 warm cache + 5 cold cache iterations = 10 total runs per version)
- Analyze results (cold vs warm cache, min/max/avg/stddev/confidence levels)
- Recommend winner with trade-off analysis
- Apply the optimization (with your confirmation)
- Validate performance after deployment
- Clean up all temporary objects
Input:
Total Revenue =
SUMX(
Sales,
Sales[Quantity] * RELATED(Products[Price])
)
Output (automated):
π― Benchmark Results (5 warm + 1 cold cache iterations)
ββββββββββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββ¬βββββββββ¬βββββββββββ¬ββββββββββββ
β Version β Cold Avg β Warm Avg β Min β Max β Std Dev β vs Orig β
ββββββββββββββββββββΌβββββββββββΌβββββββββββΌβββββββββΌβββββββββΌβββββββββββΌββββββββββββ€
β Original β 2,847 β 2,234 β 2,012 β 2,467 β 165 β Baseline β
β V1: Calc Column β 245 β 142 β 136 β 151 β 6.2 β -94% β
β V2: Iter Productsβ 892 β 287 β 276 β 301 β 10.3 β -87% β
β V3: Variables β 2,234 β 1,876 β 1,654 β 2,103 β 178 β -16% β
ββββββββββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββ΄βββββββββ΄βββββββββββ΄ββββββββββββ
*Each version tested with 5 cold cache runs + 5 warm cache runs (10 total)
π **Cache Impact**: Original 27% slower cold vs warm, V1 only 73% slower (better cache utilization)
π WINNER: Version 1 (Calculated Column)
- 15.7Γ faster warm cache (2,234ms β 142ms)
- 11.6Γ faster cold cache (2,847ms β 245ms)
- Consistency: Excellent (Ο=6.2ms, CV=4.4%)
- Trade-offs: +84 MB model, +23s refresh
- Confidence: HIGH (6.5Ο significance)
π **Tested Formulas:**
**Original:**
```dax
SUMX(Sales, Sales[Quantity] * RELATED(Products[Price]))V1 (Winner): Pre-computed column + simple SUM V2: Reversed iteration (Products β Sales) V3: Variable materialization
Apply? [Yes/No/Show All Code]
Before starting, ensure you have:
1. Power BI Desktop (Latest Version)
- Download: aka.ms/pbidesktop
- Version: November 2023 or later
- Verify: Open Power BI Desktop, check Help β About
2. VS Code with GitHub Copilot
- VS Code: code.visualstudio.com
- GitHub Copilot Extension: Install from VS Code marketplace
- Open VS Code β Extensions (Ctrl+Shift+X)
- Search "GitHub Copilot" β Install
- Sign in with GitHub account (Copilot subscription required)
- Verify: See Copilot icon in VS Code status bar
3. Python 3.8+ and pip
- Windows: python.org/downloads
- β Check "Add Python to PATH" during installation
- macOS:
brew install python3 - Linux:
sudo apt-get install python3 python3-pip - Verify: Open terminal and run:
python --version # Should show 3.8 or higher pip --version # Should show pip version
Step 1: Install Power BI MCP Server
Official guide: microsoft/powerbi-modeling-mcp
Option A: VS Code Extension (Recommended - 1 min)
- Open VS Code Extensions (Ctrl+Shift+X)
- Search for "Power BI Modeling MCP"
- Click Install on the official Microsoft extension
- Verify in GitHub Copilot chat - tools should appear automatically
Option B: NPX Installation (Cross-platform - 2 min)
# Requires Node.js installed
npx -y @microsoft/powerbi-modeling-mcp@latest --startOption C: Manual Download (Advanced) See official documentation for manual VSIX download and extraction.
Which method to choose?
- β VS Code Extension: Easiest, automatic updates, integrated with Copilot (recommended for most users)
- βοΈ NPX: Good if you prefer Node.js tooling or need cross-platform consistency
- π§ Manual: Maximum control, works with any MCP client, good for offline/air-gapped environments
Step 2: Configure MCP Settings (3 min)
Create MCP configuration file:
# Option A: Copy sample config (recommended)
cp .github/skills/powerbi-optimization/mcp-config-sample.json ~/.vscode/mcp-settings.json
# Option B: Manual creation
# Create file at: ~/.vscode/mcp-settings.json (Mac/Linux) or %USERPROFILE%\.vscode\mcp-settings.json (Windows)File contents:
{
"mcpServers": {
"powerbi-local": {
"command": "powerbi-mcp-server",
"args": ["--local", "--auto-discover"],
"env": {
"POWERBI_MODE": "local",
"BENCHMARK_WARM_ITERATIONS": "5",
"BENCHMARK_COLD_ITERATIONS": "5"
}
}
}
}Step 3: Restart VS Code (1 min)
- Close all VS Code windows
- Reopen VS Code
- MCP server will auto-load
Step 4: Test Connection (2 min)
- Open Power BI Desktop with a model
- In VS Code Copilot Chat:
@powerbi-optimization "Connect to my Power BI model" - Should see: β Connected to model with table/measure count
Troubleshooting: See MCP-GUIDE.md for detailed troubleshooting.
- β‘ 94% time savings: Manual (50 min) β Automated (3 min)
- π Statistical confidence: Real data, not guesses
- π― Objective results: Data-driven recommendations
- π Safe testing: Temporary measures, rollback on error
- π§ͺ A/B testing: Compare multiple approaches
- π Learning: See what works in your model
- Complete Guide: MCP-GUIDE.md
- Tool Reference: 8 MCP tools documented
- Configuration: mcp-config-sample.json
- Examples: Full workflow walkthroughs
- Troubleshooting: Common issues and solutions
If MCP server not available:
- Provides detailed optimization analysis
- Suggests optimized DAX code
- Guides manual benchmarking
- Interprets your benchmark results
Same expertise, automation just makes it faster!
Option 1: Use in GitHub Copilot Chat (Recommended)
-
Clone or fork this repository:
git clone https://github.com/[your-username]/Power-BI-Optimization-Skill.git
-
Copy the skill folder to your project:
cp -r .github/skills/powerbi-optimization /path/to/your/project/.github/skills/
-
Start using in Copilot Chat:
- Open your Power BI project in VS Code
- The skill automatically activates when discussing Power BI topics
- Or explicitly reference:
@powerbi-optimization
Option 2: Use as a Reference
Browse this repository to understand optimization patterns and apply them to your Power BI projects.
You: "My DirectQuery report is timing out. Can you help?"
let
Source = Sql.Database("server", "db"),
Sales = Source{[Item="Sales"]}[Data],
Custom = Table.AddColumn(Sales, "Display", each
Text.Upper([ProductName]) & " - " & Text.From([Amount])
),
Filtered = Table.SelectRows(Custom, each [Date] >= #date(2024,1,1))
in
FilteredCopilot (Power Query M Specialist activated):
π― Critical Issue: Non-Folding Transformation in DirectQuery
**Problem**: Text.Upper breaks query folding
- Power BI attempts to load ALL rows
- Causes timeout or out-of-memory
- Report broken β
**Fix**: Remove custom column or compute in source
[Detailed solution with SQL view approach]
Expected: Timeout β 200ms queries β
You: "I have a 50GB fact table. Should I use Import or DirectQuery?"
Copilot (Model Design Specialist activated):
π― Recommendation: Composite Model
**Analysis**:
- 50GB too large for Import (memory limits)
- Real-time data need identified
- Small dimensions detected
**Solution**:
- Facts: DirectQuery (large, real-time)
- Dimensions: Import (small, instant filters)
- Aggregations: Import (90% queries from cache)
Expected: Real-time data + good performance β
You: "My queries are 10x slower with RLS enabled"
// RLS filter on Sales table
VAR UserRegion =
CALCULATE(
VALUES(Users[Region]),
FILTER(ALL(Users), Users[Email] = USERPRINCIPALNAME())
)
RETURN
[Region] IN UserRegion
Copilot (Security & RLS Specialist activated):
π― Issue: Complex RLS Filter (Formula Engine)
**Problem**:
- Formula engine evaluation every query
- Bi-directional filtering compounds issue
- 10x slowdown measured
**Fix**: Security table with relationship
[Detailed implementation]
Expected: 10x β 1.3x overhead (87% improvement) β
See examples/sample-prompts.md for 50+ example prompts covering:
- DAX Optimization: Iterator patterns, context transitions, calculation groups
- Model Design: Star schema, relationships, storage modes
- Report Performance: Visual optimization, mobile layouts, accessibility
- Power Query: Query folding, refresh performance, incremental loading
- Security: RLS patterns, dynamic security, embedding
This skill provides two ways to leverage Best Practice Analyzer rules:
Analyze .pbip models directly without external tools!
@powerbi-optimization "Analyze my model with BPA rules"
What you get:
- β Instant analysis of 30+ BPA rules
- β Context-aware explanations (not just rule violations)
- β Conversational fix guidance
- β Iterative validation in same chat
- β Works with Git-tracked .pbip files
How it works:
- I parse your
model.bimor.Dataset/model.bimfile - Apply 30 BPA rules programmatically
- Analyze business impact and prioritize
- Provide step-by-step fix guidance
- Validate fixes when you re-run analysis
Supported rules:
- β All DAX expression rules (4/4)
- β All formatting rules (2/2)
- β All metadata rules (3/3)
- β Most layout rules (6/8)
- β All naming rules (5/5)
- β Most performance rules (4/5)
π Complete Built-in Analyzer Guide
For complete 40-rule coverage and CI/CD automation, use Tabular Editor BPA and bring results to this skill for analysis.
| What You Get | BPA | This Skill | Both Together |
|---|---|---|---|
| Automated checks | β 40+ rules | β Manual | β Best of both |
| Context-aware analysis | β Rule-based only | β Understands your model | β Intelligent triage |
| Implementation guidance | β Step-by-step | β Complete workflow | |
| CI/CD integration | β Scriptable | β Conversational | β Automated quality gates |
| False positive handling | β Context filters them | β Smart filtering |
# 1. Download BPA rules
$url = "https://github.com/TabularEditor/BestPracticeRules/releases/latest/download/BPARules-standard.json"
Invoke-WebRequest -Uri $url -OutFile "$env:LOCALAPPDATA\TabularEditor\BPARules-standard.json"
# 2. Run in Tabular Editor: Tools β Best Practice Analyzer
# 3. Bring results to this skill:In Copilot:
@powerbi-optimization "BPA found these issues:
- DAX_DIVISION_COLUMNS (Severity 3): 8 measures
- META_SUMMARIZE_NONE (Severity 1): 32 columns
- PERF_UNUSED_COLUMNS (Severity 2): 12 columns
Which should I prioritize? What's the risk?"
| Category | Rules | Specialist | Auto-Fix Available |
|---|---|---|---|
| DAX Expressions | 4 rules | @dax-mastery | β Requires analysis |
| Formatting | 2 rules | @model-design | β Manual format selection |
| Metadata | 3 rules | @model-design | β SummarizeBy, data types |
| Model Layout | 8 rules | @report-performance | β Hide FK, perspectives |
| Naming Conventions | 5 rules | All specialists | β Requires strategy |
| Performance | 5 rules | @model-design | β Delete unused objects |
Total: 40+ production-ready rules
BPA finds violations β Skill provides context β You implement β BPA validates
Step 1: Run BPA
- Severity 3: 5 critical issues
- Severity 2: 12 high-priority issues
- Severity 1: 23 low-priority issues
Step 2: Ask the skill
"Triage my BPA results by business impact.
What order should I fix these? Any false positives?"
Step 3: Skill analyzes
"π΄ Fix immediately: DAX_DIVISION_COLUMNS (5 measures)
Risk: Division by zero in user-facing reports
Impact: Potential calculation errors
Time: 15 minutes
π‘ Next sprint: META_AVOID_FLOAT (2 columns)
Risk: Precision issues in financials
Impact: Rounding errors
Time: 30 minutes + testing
βͺ Technical debt: LAYOUT violations (23 items)
Risk: Low (cosmetic)
Impact: User experience
Time: 2-3 hours for all"
Step 4: Implement fixes
Step 5: Validate with BPA
- Re-run BPA: 0 critical violations β
π Read the full BPA Integration Guide
Covers:
- β Setup and installation (3 methods)
- β Complete rule catalog with examples
- β Integration workflows (3 patterns)
- β CI/CD pipeline templates (Azure DevOps, GitHub Actions)
- β Troubleshooting common issues
- β Custom rule creation
Power BI Desktop includes Performance Analyzer - capture visual timings and I'll help you optimize!
Step 1: Prepare for Clean Measurements
- Navigate to a blank page (or create a new blank page)
- Save Power BI Desktop (with the blank page selected)
- Close Power BI Desktop completely
- Open the file in Power BI Desktop (blank page should be visible)
- Open Performance Analyzer (View ribbon β Performance Analyzer)
- Click Start Recording
- Navigate to one or more of the other non-blank pages to measure
- Click Stop Recording
- Click Export β saves JSON file
Why start with a blank page? This ensures Performance Analyzer captures a clean baseline without interference from previously loaded visuals, giving you accurate measurements of each page's true load time.
Step 2: Analyze with This Skill
@powerbi-optimization "Analyze this Performance Analyzer export"
[Paste JSON content or attach file]
Step 3: Get Prioritized Recommendations
π― Performance Analysis Results
Page Summary:
- 8 visuals analyzed
- Total page load: 12.4s β οΈ (Target: <5s)
- Slowest: Sales by Category (2.8s) β
Critical Issues:
1. Sales by Category: 2.8s query
β’ 23% of page load from one visual
β’ ACTION: Share DAX code for optimization
2. Top Products: 1.9s query
β’ Possible iterator issue
β’ ACTION: Analyze measure
Quick Wins:
- 3 card visuals using same measure
β Consolidate with field parameters
β SAVINGS: 800ms (7% faster)
Next: Share DAX code for identified measuresFrom Performance Analyzer JSON, I identify:
β Performance Bottlenecks
- Slowest visuals ranked
- Disproportionate query times
- Total page load time
β Optimization Opportunities
- DAX measures needing optimization
- Visual consolidation opportunities
- Redundant queries
- Filter propagation issues
β Benchmarking
- Visual query times vs standards
- Page load vs targets
- Per-visual impact assessment
Visual Query Times:
- β Excellent: <100ms
- β Good: 100-500ms
β οΈ Acceptable: 500ms-1s- β Needs optimization: >1s
Page Load Times:
- β Excellent: <2s
- β Good: 2-5s
β οΈ Acceptable: 5-10s- β Needs work: >10s
1. Run Performance Analyzer in Power BI Desktop
2. Export JSON
3. Bring to this skill for analysis
4. Get prioritized recommendations
5. Share DAX code for slow measures
6. Implement optimizations
7. Re-run Performance Analyzer to validate
8. Repeat for remaining issues
| Feature | Performance Analyzer | DAX Studio |
|---|---|---|
| Built-in | β Yes | β External |
| Visual timing | β Per visual | β Query only |
| Total time | β Yes | β Yes |
| SE vs FE split | β No | β Yes |
| Query plan | β No | β Yes |
| Ease of use | β Export JSON | |
| Best for | Visual bottlenecks | DAX deep dive |
Recommended Approach:
- Start with Performance Analyzer (built-in, easy)
- Identify slow visuals
- Use this skill to analyze patterns
- Share DAX for optimization
- Use DAX Studio for deeper analysis if needed
When Performance Analyzer reveals slow queries, I'll:
- Identify which measures need optimization
- Handoff to @dax-mastery specialist if needed
- Provide before/after benchmarks
- Guide validation workflow
π See full Performance Analyzer guide in SKILL.md
Power BI Optimization Skill/
βββ README.md (this file)
β βββ Overview and getting started
β βββ Architecture explanation
β βββ Usage examples
β βββ Roadmap
β
βββ .github/skills/powerbi-optimization/
β βββ SKILL.md (hub skill - comprehensive triage)
β β
β βββ BPA-GUIDE.md (β Built-in BPA analysis + Tabular Editor integration)
β β βββ Direct model analysis (no external tools)
β β βββ 30+ built-in rule implementations
β β βββ Complete 40-rule Tabular Editor catalog
β β βββ Integration workflows and CI/CD examples
β β βββ Troubleshooting and setup
β β
β βββ specialists/
β β βββ dax-mastery.md (~1,000 lines, 20+ patterns)
β β βββ model-design.md (~3,500 lines, 7 patterns)
β β βββ report-performance.md (~3,200 lines, 7 patterns)
β β βββ powerquery-m.md (~3,800 lines, 7 patterns)
β β βββ security-rls.md (~4,200 lines, 7 patterns)
β β
β βββ templates/
β βββ analysis-report.md (output template)
β
βββ examples/
βββ sample-prompts.md (50+ example prompts)
Total Expertise: ~16,000 lines | 47+ patterns | 40+ BPA rules | 30+ built-in rules | All core domains covered
Contributions welcome! Here's how:
Found a bug or have a suggestion? Open an issue
- Fork the repository
- Create feature branch:
git checkout -b feature/your-feature - Make changes and test
- Commit:
git commit -m "Add: feature description" - Push:
git push origin feature/your-feature - Submit pull request
Help us add more examples, clarify instructions, or share use cases
Contribute new optimization patterns from your experience
- 5 Specialists: Production-ready, deep domain expertise
- 47+ Patterns: Real-world, tested optimization strategies
- 40+ BPA Rules: Full Tabular Editor BPA catalog reference
- 30+ Built-in Rules: Direct BPA analysis without external tools
- 16,000+ Lines: Comprehensive guidance and examples
- ~13,000 Lines: Storage mode best practices (Import, DirectQuery, Composite)
- Real Metrics: Actual before/after performance measurements
- 3 Storage Modes: Complete coverage (Import, DirectQuery, Composite)
- Full Integration: Seamless BPA + Skill workflows with CI/CD templates
-
Clone or fork this repository:
git clone https://github.com/[your-username]/Power-BI-Optimization-Skill.git
-
Copy the skill folder to your project:
cp -r .github/skills/powerbi-optimization /path/to/your/project/.github/skills/
-
Start using in Copilot Chat:
- Open your Power BI project in VS Code
- The skill will automatically activate when discussing Power BI topics
- You can also explicitly reference it:
@workspace /powerbi-optimization
Simply reference this repository's skill definition in your own projects to understand the structure and adapt it to your needs.
You: "This measure is taking too long to calculate. Can you optimize it?"
Total Revenue =
SUMX(
Sales,
Sales[Quantity] * RELATED(Products[UnitPrice])
)
Copilot (with Power BI Optimization Skill):
## π― Analysis Summary
I've identified a performance optimization opportunity in your measure...
### Issue: Expensive Iterator with RELATED
**Priority**: P1 - High
**Impact**: Performance (Formula Engine)
**Problem**:
Using RELATED inside SUMX forces row-by-row evaluation...
[Detailed analysis and optimized solution provided]You: "I have multiple many-to-many relationships in my model. Is this a good design?"
Copilot (with Power BI Optimization Skill):
## π― Analysis Summary
Many-to-many relationships can work, but let's review best practices...
[Detailed analysis of relationship patterns, alternatives, and recommendations]You: "My report has 25 visuals and takes 60 seconds to load. How can I speed it up?"
Copilot (with Power BI Optimization Skill):
## π― Analysis Summary
**Priority Issues Found**:
- P0: 1 (Too many visuals causing timeout risk)
- P1: 3 (Performance bottlenecks)
- P2: 4 (UX improvements)
[Detailed prioritized recommendations with quick wins]See examples/sample-prompts.md for a comprehensive list of prompts you can use, including:
- DAX optimization scenarios
- Semantic model design questions
- Report performance troubleshooting
- Best practice inquiries
- Complex calculation assistance
The skill is designed with extensibility in mind. See docs/architecture.md for details on:
- How the skill detection and triggering works
- Analysis framework and methodology
- Integration points for external tools
- Future enhancement opportunities
See docs/roadmap.md for our vision:
- V1 (Current): Static analysis and recommendation engine
- V2 (Planned): Integration with Tabular Editor BPA and Fabric APIs
- V3 (Future): Automated testing, MCP server, and real-time telemetry
Contributions are welcome! Here's how you can help:
Found a bug or have a suggestion? Open an issue
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Add or update tests if applicable
- Commit with clear messages:
git commit -m "Add: feature description" - Push to your fork:
git push origin feature/your-feature-name - Submit a pull request
Help us improve examples, add more prompts, or clarify instructions.
Share how you're using this skill in your Power BI projects!
- SKILL.md: Complete skill definition and instructions
- architecture.md: Technical architecture and design
- roadmap.md: Future enhancements and versioning
- sample-prompts.md: Example prompts and use cases
This project is licensed under the MIT License - see the LICENSE file for details.
Built with inspiration from:
- SQLBI.com - DAX patterns and best practices (Marco Russo, Alberto Ferrari)
- Power BI Community - Real-world optimization scenarios
- Microsoft Power BI Documentation - Official guidance and storage mode details
- Tabular Editor - Best Practice Analyzer framework
- DAX Studio - Query performance analysis tools
Special thanks to the Power BI community for sharing optimization patterns and battle-tested solutions.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Community: Power BI Community Forums
If you find this skill useful, please star β the repository to help others discover it!
Made with β€οΈ by the Power BI Community
Optimize your Power BI reports, one measure at a time.