- Home
- Skills
- Code Quality & Review
- DAX Formula Reviewer: Catch Slow Power BI Patterns
DAX Formula Reviewer: Catch Slow Power BI Patterns
**DAX Formula Reviewer** is an offline, comment- and string-aware Python static parser and linter for Power BI semantic model measures.
Free
Works with the AI Agents you already use
DAX Formula Reviewer: Catch Slow Power BI Patterns
Example session with this skill installed
Review my Power BI DAX measures in examples/sales_measures.dax, rank all performance and correctness anti-patterns by severity, calculate a health score, and write concrete DAX rewrites into examples/sample_output without modifying my original file.
- Read your context and instructions
- Compiled the dax formula reviewer
Verified CLI execution output on examples/sales_measures.dax:
DAX Review Complete | Measures: 10 | Findings: 13 (C:2 H:5 M:4 L:2) | Health Score: 83.7/100 (B)
Outputs written to: D:\agensi-skills\skills\dax-formula-antipattern-reviewer\examples\sample_output
- report: dax_review_report.md
- csv: dax_findings.csv
- json: dax_summary.json
- dax: dax_rewrites.dax
Generated examples/sample_output/dax_review_report.md excerpt:
# DAX Formula Anti-Pattern Review Report
- **Input Target:** `sales_measures.dax`
- **Measures Analyzed:** 10
- **Clean Measures:** 2 | **Flagged Measures:** 8
- **Total Findings:** 13 (CRITICAL: 2, HIGH: 5, MEDIUM: 4, LOW: 2)
- **Overall DAX Health Score:** **83.7 / 100 (Grade B)** (Median: 81.0, P25: 72.8)
## Measure Health Scorecard
| Table | Measure | Score | Grade | Critical | High | Medium | Low |
| --- | --- | ---: | :---: | ---: | ---: | ---: | ---: |
| FactSales | Margin Tier Label | 69 | C | 0 | 1 | 2 | 0 |
| FactSales | High Value North Orders | 70 | C | 0 | 2 | 0 | 0 |
| FactSales | 2025 YTD via Format | 72 | C | 1 | 0 | 0 | 1 |
| FactSales | Electronics Revenue (Slow) | 75 | B | 1 | 0 | 0 | 0 |
| FactSales | Gross Margin % | 77 | B | 0 | 1 | 1 | 0 |
| FactSales | Active Store Customers | 85 | B | 0 | 1 | 0 | 0 |
| FactSales | Unqualified Net Sum | 92 | A | 0 | 0 | 1 | 0 |
| FactSales | High Ticket Order Count | 97 | A | 0 | 0 | 0 | 1 |
| FactSales | Total Revenue | 100 | A | 0 | 0 | 0 | 0 |
| FactSales | Clean YoY Revenue Growth % | 100 | A | 0 | 0 | 0 | 0 |
## Severity-Ranked Findings & Rewrites
### 1. [CRITICAL] DAX001 — `FactSales[Electronics Revenue (Slow)]` (Line 11)
- **Category:** Storage Engine & Filter Context
- **Detected Pattern:** `FILTER ( ALL ( 'DimProduct'[Category] ), 'DimProduct'[Category] = "Electronics" )`
- **Why It Hurts:** FILTER(ALL(...)) inside CALCULATE() forces row-by-row Formula Engine iteration over an expanded table instead of Storage Engine pushdown.
- **Recommended Rewrite:** `Use direct boolean filter or REMOVEFILTERS: CALCULATE(<expr>, REMOVEFILTERS('DimProduct'[Category]), 'DimProduct'[Category] = "Electronics")`
### 2. [CRITICAL] DAX001 — `FactSales[2025 YTD via Format]` (Line 47)
- **Category:** Storage Engine & Filter Context
- **Detected Pattern:** `FILTER ( ALL ( 'DimDate'[Date] ), FORMAT ( 'DimDate'[Date], "yyyy" ) = "2025" )`
- **Why It Hurts:** FILTER(ALL(...)) inside CALCULATE() forces row-by-row Formula Engine iteration over an expanded table instead of Storage Engine pushdown.
- **Recommended Rewrite:** `Use direct boolean filter or REMOVEFILTERS: CALCULATE(<expr>, REMOVEFILTERS('DimDate'[Date]), FORMAT ( 'DimDate'[Date], "yyyy" ) = "2025")`
### 3. [HIGH] DAX002 — `FactSales[Gross Margin %]` (Line 15)
- **Category:** Runtime Safety & Error Handling
- **Detected Pattern:** `( [Total Revenue] - [Total Cost] ) / [Total Revenue]`
- **Why It Hurts:** Raw '/' division operator can return Infinity/-Infinity or runtime errors when denominator is 0 or BLANK().
- **Recommended Rewrite:** `DIVIDE(( [Total Revenue] - [Total Cost] ), [Total Revenue], 0)`
Connects securely to your tools. The creator never sees your data.
About this skill
Slow Power BI report pages rarely come from data volume alone—they usually stem from a handful of costly DAX patterns hidden inside measure definitions: FILTER(ALL(...)) forcing row-by-row Formula Engine scans, raw / division returning Infinity, bidirectional CROSSFILTER(..., BOTH) traps, nested CALCULATE() context transitions, IFERROR() disabling Storage Engine batch pushdown, and uncached repeated [Measure] calls.
DAX Formula Reviewer is an offline, comment- and string-aware Python static parser and linter for Power BI semantic model measures. It audits .dax, .txt, .csv, .json, and .jsonl exports (or whole folders of scripts) without requiring Power BI Desktop, Excel, or a live Analysis Services connection.
What It Checks (DAX001–DAX010)
- CRITICAL (
DAX001):FILTER(ALL(...))/FILTER(ALLSELECTED(...))insideCALCULATE()or iterators, withREMOVEFILTERS()/ boolean predicate rewrites. - HIGH (
DAX002–DAX005): Unguarded/division withoutDIVIDE(), bidirectionalCROSSFILTER(..., BOTH)traps, nestedCALCULATE()insideCALCULATE()or row iterators, and whole-tableFILTER(FactTable, ...)scans. - MEDIUM (
DAX006–DAX009): Repeated[Measure]references withoutVAR ... RETURNcaching, legacyEARLIER()/EARLIEST(),IFERROR()/ denseIF(..., ..., 0)coercion, and unqualifiedSUM([Col])column references. - LOW (
DAX010):COUNTROWS(FILTER(...)), non-sargableFORMAT()inside filter predicates, andALL()used as aCALCULATEmodifier instead ofREMOVEFILTERS().
Deliverables (Strictly Read-Only on Inputs)
Every run writes four clean outputs into --output-dir without altering your source files:
dax_review_report.md— Executive summary,0–100DAX Health Score (A–F), per-measure scorecard, and severity-ranked rewrites.dax_findings.csv— Flat issue log ready for Excel, Power BI, or sprint backlog tracking.dax_summary.json— Machine-readable KPIs (mean, median, P25 scores, severity counts, rule counts, findings array) for CI/CD gates (--fail-on-critical).dax_rewrites.dax— Annotated DAX Studio script showing[CLEAN]vs[FLAGGED]status and suggested rewrites inline above each measure.
Fits Your BI & Analytics Workflow
Designed to pair seamlessly with Power BI Model & DAX Helper, Star Schema Designer, and Retail Data Cleaner—including automatic qa_flags CSV row filtering when auditing cleaned metadata exports.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
- Performs static lexical/structural analysis without connecting to a live VertiPaq/Analysis Services engine, so it cannot measure actual table cardinalities, relationship directions in
.pbixmetadata, or query execution timings. .xlsxworkbooks are not parsed directly; export measures to.dax,.csv, or.json/.jsonlfirst.- Repeated-measure caching (
DAX006) checks whetherVARis present in the measure and flags repeated[Measure]calls whenVARis absent. - Suggested rewrites are high-accuracy templates that should be validated against your semantic model's exact filter context and relationship design.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account
- Software
- Python 3.9+ with pandas and numpyLocal read access (.dax, .csv, .json, .jsonl)Write access to --output-dir
Python
- Optional
- DAX StudioTabular Editor
Runs 100% locally offline with zero network calls, zero telemetry, and strict read-only handling of original input files.