/power-bi-development:power-bi-dax-optimizationfrom power-bi-development
Analyzes and optimizes Power BI DAX formulas for performance, readability, maintainability, and best-practice compliance. Reviews variables, context transitions, filter efficiency, and function choice.
Ships in power-bi-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Review a DAX formula and return an optimized version with the bottlenecks, strategy, expected impact, and testing recommendations clearly tied to the original calculation.
Use the provided DAX formula as the source of truth. Ask for or infer context only when needed: business purpose, data model relationships, current performance symptoms, report visual usage, and whether the goal is performance, readability, best-practice compliance, error handling, or documentation.
| Area | Check | Preferred pattern |
|---|---|---|
| Performance Analysis | Repeated expressions, expensive iterators, inefficient filters, unnecessary context transitions, poor aggregation choices | Store repeated calculations in VAR, minimize context transitions, use table expressions deliberately, and choose efficient aggregations. |
| Readability Assessment | Formula structure, naming, comments, logical flow, and nesting depth | Use descriptive variables, consistent indentation, and comments only for business logic. |
| Best Practices Compliance | Variables, column vs measure references, error handling, and function choice | Prefer DIVIDE over /, COUNTROWS over COUNT for row counts, and SELECTEDVALUE over naked VALUES when a scalar is expected. |
| Maintainability Review | Hard-coded values, complexity, modularity, dependencies, reusability | Parameterize business constants where appropriate and split reusable logic into base measures. |
| Pattern | Use when | Example direction |
|---|---|---|
| Variable Usage | The same expression appears more than once or an intermediate value clarifies intent | Put expensive calculations in VAR DescriptiveVariableName = ... and reference the variable in RETURN. |
| Function Selection | A formula uses generic or unsafe functions | Replace / with DIVIDE, COUNT with COUNTROWS, and VALUES with SELECTEDVALUE when a single value is expected. |
| Context Optimization | Iterator functions or nested CALCULATE calls create avoidable context transitions | Move filters into one clear CALCULATE and avoid row context where a measure can aggregate directly. |
| Filter Efficiency | Filters are complex, repeated, or hard to reason about | Use clear table expressions and avoid broad filters that fight existing report context unless intentional. |
| BLANK Handling | Formula coerces blanks to zero unnecessarily | Preserve BLANK() where it communicates missing data and improves visual behavior. |
| Documentation | Business rules are non-obvious | Add concise comments for business logic, not syntax. |
Input:
Sales Growth = ([Total Sales] - CALCULATE([Total Sales], PARALLELPERIOD('Date'[Date], -12, MONTH))) / CALCULATE([Total Sales], PARALLELPERIOD('Date'[Date], -12, MONTH))
Optimized direction: store prior-period sales once, use DIVIDE, and preserve blank semantics.
Sales Growth =
VAR CurrentSales = [Total Sales]
VAR PriorYearSales =
CALCULATE(
[Total Sales],
PARALLELPERIOD('Date'[Date], -12, MONTH)
)
RETURN
DIVIDE(CurrentSales - PriorYearSales, PriorYearSales)
### DAX optimization result
**Status:** optimized | needs context | blocked
**Measure:** `<measure name or unknown>`
**Primary goal:** performance | readability | maintainability | error handling | best practices
#### Original formula analysis
- Performance Issues: <list>
- Readability Concerns: <list>
- Best Practice Violations: <list>
- Potential errors or edge cases: <list>
- Maintenance challenges: <list>
#### Optimization strategy
- <variable usage opportunities>
- <function replacements>
- <context optimization techniques>
- <error handling improvements>
#### Optimized formula
```dax
<optimized formula>
| Change | Why | Expected impact | Trade-off |
|---|---|---|---|
<change> | <reason> | <impact> | <trade-off or none> |
## Quality gate
- [ ] The original business meaning is preserved unless a deliberate behavior change is called out.
- [ ] Repeated expensive expressions are evaluated once with `VAR` where appropriate.
- [ ] Division uses `DIVIDE` unless ordinary `/` is intentionally justified.
- [ ] Row counts use `COUNTROWS` where row-count semantics are intended.
- [ ] Scalar selection uses `SELECTEDVALUE` where a single value is expected.
- [ ] `BLANK()` behavior is preserved or the change is explained.
- [ ] The optimized DAX is formatted and paste-ready.
- [ ] The explanation includes performance, readability, maintainability, and testing guidance.
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/power-bi-model-design-reviewReview Power BI data model architecture, relationships, storage modes, performance, security, governance, and maintainability. Use this skill when asked for a Power BI model design review, star schema assessment, relationship design evaluation, pre-production model review, modernization assessment, or optimization roadmap./power-bi-performance-troubleshootingDiagnose and resolve Power BI performance issues across semantic models, reports, DAX, refresh, DirectQuery, gateways, and Fabric or Premium capacity. Use this skill when asked to troubleshoot slow Power BI reports, page loading, visual interactions, query execution, model refresh, capacity pressure, or gateway bottlenecks./power-bi-report-design-consultationDesign effective Power BI report layouts, chart selections, interactions, accessibility, mobile views, and implementation guidance. Use when asked for Power BI visualization design, dashboard layout, chart choice, KPI report structure, slicer/navigation design, accessibility review, mobile report design, or report UX consultation.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin power-bi-developmentOther plugins' skills for the same job