bi-measure-builder
Writes, explains, debugs, and optimizes BI calculations - Power BI / Fabric DAX measures and calculated columns, Tableau calculated fields…
Skill by OneWave-AI
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/onewave-ai-bi-measure-builder
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/bi-measure-builder
What's inside
- Skill name
bi-measure-builder- Description
- Writes, explains, debugs, and optimizes BI calculations - Power BI / Fabric DAX measures and calculated columns, Tableau calculated fields (FIXED/INCLUDE/EXCLUDE LOD expressions, table calculations), and Looker LookML measures, dimensions, and derived tables. Use it whenever the request involves DAX, CALCULATE, a Power BI measure, a Tableau calc or LOD, LookML, or a business metric such as YoY, YTD, rolling 12 months, running total, percent of total, distinct customers, ranking, new vs returning customers, closing balances, or basket analysis. Use it especially when someone says a measure "shows the wrong total", "is blank", "ignores my slicer/filter", "repeats the same value on every row", or "is slow" - those are filter context, context transition, LOD order-of-operations, or fanout bugs this skill is built to diagnose. Produces the formula, the context it evaluates in, and a hand-checkable test with expected numbers.
- License
- MIT
- Instructions
- 65 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (26)
- SKILL.md
- actual_yoy_fixed.csv · examples/
- actual_yoy_from_tool.csv · examples/
- worked-example.md · examples/
- yoy_spec.json · examples/
- dax.md · references/
- looker.md · references/
- tableau.md · references/
- measure_check.py · scripts/
- balances.csv · tests/fixtures/
- sales.csv · tests/fixtures/
- balance_global_last.json · tests/specs/
- balance_per_entity.json · tests/specs/
- distinct_customers.json · tests/specs/
- new_customers.json · tests/specs/
- new_customers_east.json · tests/specs/
- pct_region.json · tests/specs/
- prior_year.json · tests/specs/
- rank_customer.json · tests/specs/
- returning_customers.json · tests/specs/
- rolling_3m.json · tests/specs/
- running_total.json · tests/specs/
- yoy_pct.json · tests/specs/
- ytd.json · tests/specs/
- ytd_fiscal_jul.json · tests/specs/
- test_measure_check.py · tests/
SKILL.md (first lines)
# BI Measure Builder
Most wrong BI numbers are not syntax errors. They are the right formula evaluated in the wrong context. Work context-first, and prove every measure against numbers computed independently.
## Workflow
1. **Pin down the model before writing anything.** Get (or state as an explicit assumption): the fact table and its grain (one row per order line? per snapshot?), dimension tables, relationship keys and direction, and the date table. Ask only for what changes the formula; otherwise state the assumption and proceed. Why: the same YoY formula is right on a star schema and wrong on a flat table with a text date.
2. **Name the platform and version features.** DAX: classic vs calendar-based time intelligence (preview), marked date table or not. Tableau: live vs extract, context filters in use. Looker: dialect (window-function support, `period_over_period` support).
3. **State the evaluation context in one or two sentences** for a typical visual cell *and* for the grand total. Example: "Row = Month; filters = Region slicer; total = all months in the slicer range, recomputed, not summed." Why: this is where most bugs live, and saying it forces the check.
4. **Write the calculation** from the matching pattern in the reference file. Use variables (DAX `VAR`) for readability and to evaluate each sub-expression once.
5. **Explain it** line by line in terms of context: what each filter argument adds, removes, or overrides; where context transition happens; which Tableau pipeline step each part runs in; which part Looker runs in SQL vs after the query.
6. **Give a hand-computable test**: a 5-10 row sample, the visual layout, and the expected value for each row and the total. Generate or confirm the numbers with `scripts/measure_check.py` (below) rather than mental arithmetic.
7. **Performance notes** only where they matter: iterator size, context transition inside large iterators, table filters vs column filters, bidirectional relationships, LOD on high-cardinality dimensions, PDT persistence.
## References (load only the one needed)
- `references/dax.md` - DAX semantics recap plus patterns: YoY, YTD/fiscal YTD, rolling N, running total, % of total/parent, distinct count, ranking, new vs returning, semi-additive balances, basket.
- `references/tableau.md` - order of operations, LOD vs table calc choice, the same pattern set.
- `references/looker.md` - measure types, symmetric aggregates and fanout, post-SQL measure limits, `period_over_period`, derived tables, the same pattern set.
- `examples/worked-example.md` - a full run: "YoY % total is wrong" diagnosed, fixed in all three tools, verified with the script.
## Top traps and the fix for each
| Trap | Symptom | Fix |
|---|---|---|
| CALCULATE boolean filter *replaces* the existing filter on that column | "Blue sales" shows the same number on every color row | Wrap in `KEEPFILTERS(...)` to intersect instead of overwrite, when the intent is "within the current selection" |
| Filtering a whole table in CALCULATE (`FILTER(Sales, ...)`) | Wrong numbers via expanded-table intersection; very slow | Filter columns: `KEEPFILTERS(Sales[Qty] * Sales[Price] >= 500)` |
| Context transition surprise | Measure referenced inside `SUMX`/`FILTER`/calculated column gives per-row results or double counts duplicate rows | Know that a measure reference is an implicit CALCULATE; iterate a unique key (`VALUES(Table[Key])`), not a table with duplicate rows |
| Aggregator where an iterator is needed | `SUM(Sales[Qty]) * SUM(Sales[Price])` is wrong | `SUMX(Sales, Sales[Qty] * Sales[Price])` |
| Non-additive total "fixed" by summing | Distinct count or % total "doesn't add up" | Usually correct as-is. Only if the business wants a visual total: `SUMX(VALUES(dim[key]), [Measure])` |
| Time intelligence without a proper date table | Blank or wrong YoY/YTD, errors on gaps | Classic DAX: contiguous date table marked as date table, relationship from it to the fact. Calendar-based: define a calendar. Never use the fact's own date column |
| BLANK vs 0 | Visual explodes to every customer; `= 0` tests misfire | Return BLANK when there is nothing meaningful (`DIVIDE` without the 3rd arg); test with `ISBLANK` or `==`, since `BLANK() = 0` is TRUE |
| Bidirectional relationships as a shortcut | Ambiguity, slow, confusing slicers | Single-direction model; enable `CROSSFILTER(..., BOTH)` inside the one measure that needs it |
| Tableau FIXED ignores the dimension filter | LOD total unchanged when user filters | FIXED runs before dimension filters: add the filter to context, or use INCLUDE/EXCLUDE (run after dimension filters) |
| Tableau table calc sees only what is in the view | YoY blank for first year, rolling window truncated after filtering | Filter with a table-calc filter (runs after the calc) instead of a dimension filter; densify missing dates |
| Tableau total vs COUNTD / averages | Grand total differs from the row sum | "Automatic" totals re-aggregate underlying data (usually right); "Total Using: Sum" sums what is visible |
| Looker fanout on one-to-many joins | Sums inflated after adding a joined view | Set `primary_key: yes` on every view and a correct `relationship:`; Looker then applies symmetric aggregates. For denormalized tables use `sum_distinct` + `sql_distinct_key` |
| Looker post-SQL measures | `running_total` / `percent_of_total` wrong, null, or unfilterable | They compute after the query on returned rows only: row limits break them, they cannot be filtered or referenced by other measures. Move logic to SQL (derived table + window function) when it must be exact |
| Looker `filters:` on `type: number` | Filter silently not applied | Put `filters:` on the component `sum`/`count` measures, then combine them in the `type: number` measure |
## Verification script
`scripts/measure_check.py` is an independent oracle (pandas). Give it the user's sample CSV and a JSON spec; it prints the expected value for every visual row and for the total, evaluated the way BI tools do (total recomputed in its own context, time calcs reading outside the slicer range, empty = BLANK). With `--actual` it diffs against what the tool shows and exits 1 on mismatch.
```bash
python scripts/measure_check.py --data sample.csv --spec spec.json [--actual tool_output.csv] [--json]
```
Spec fields: `calc` (`sum`, `count_rows`, `distinct_count`, `prior_year`, `yoy_delta`, `yoy_pct`, `ytd`, `running_total`, `rolling`, `new_customers`, `returning_customers`, `last_balance`, `pct_of_total`, `rank`), `date_column`, `value_column`, `key_column` (customer/entity/distinct key), `group_column` (for pct/rank), `grain` (`day|month|quarter|year`), `range` (`{start, end}` = report date filter), `filters` (`{column: [values]}`), `params` (`window`, `fiscal_year_start_month`, `ties: skip|dense`, `order`, `mode: per_entity|global_last_date`). Examples of every calc: `tests/specs/`. Self-test: `python tests/test_measure_check.py`.
When the user has no sample, build a 5-10 row one that exercises the edge that matters (a missing month, a customer with no prior purchase, an entity without an end-of-month snapshot) and show it.
## Output format
Return, in this order:
1. **Assumptions** - model, grain, relationships, date table (bullets, only what matters).
2. **Evaluation context** - one sentence for a row, one for the total.
3. **The code** - one fenced block per tool requested, named measures, formatted.
4. **How it works** - short, context-focused explanation.
5. **Test** - sample table, expected results table (rows + total), and the spec used if the script was run.
6. **Gotchas / performance** - only the ones relevant to this model.
When debugging an existing measure, lead with the one-line root cause, then the corrected code, then the test that shows old vs new values.From OneWave-AI/claude-skills, MIT.
More from OneWave-AI/claude-skills
- 0.625score
scout-pro
OneWave-AI
Enhanced skill navigator that maps conversation history, recommends multi-skill chains, identifies patterns from past usage, and learns from session outcomes.
SkillAFreshness: A★ 373Claude Code +9 - 0.623score
gillby-water
OneWave-AI
Plan Florida boating, fishing, paddling, surf and beach outings using Gillby's sourced marine forecasts, tides, coastal places and vessel-aware tools.
SkillAFreshness: A★ 373Claude Code +9 - 0.620score
scout
OneWave-AI
Analyzes current conversation context to recommend the best skills and subagents for the task at hand.
SkillAFreshness: A★ 373Claude Code +9 - 0.592score
devils-advocate
OneWave-AI
Argues the strongest honest case against a decision, plan, belief, hire, pricing move, strategy, or piece of work the user is leaning toward.
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
code-review-pro
OneWave-AI
Performs a deep code review of files, modules, a diff, or a branch - finding security vulnerabilities (mapped to OWASP Top 10:2025), correctness bugs…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
landing-page-copywriter
OneWave-AI
Writes conversion-focused landing page copy - headlines, subheads, value propositions, feature and benefit blocks, social proof, FAQs, and CTA button text -…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
database-schema-designer
OneWave-AI
Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
design-export-repair
OneWave-AI
Fixes broken decks/PDFs exported from Claude's "Design" feature (or similar AI deck generators) — cut-off or clipped text, wrong/substituted fonts, and…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
csv-excel-merger
OneWave-AI
Merges, appends, joins, and deduplicates multiple CSV, TSV, and Excel files (including multi-sheet workbooks) with pandas - mapping mismatched column names to…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
bookkeeping-close
OneWave-AI
Runs small and midsize business bookkeeping operations - categorizes bank and card transactions to a chart of accounts, reconciles a bank or card statement…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
crm-data-cleanup
OneWave-AI
Cleans up CRM data from HubSpot, Salesforce, Pipedrive, Zoho, Close, Attio, or any CRM CSV export.
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
jev-eval
OneWave-AI
Build and run a labelled eval set for a System One model (Jev, Von, or any typed-decision config), then sweep criteria wordings and thresholds against it.
SkillBFreshness: B★ 373Claude Code +9
Signals
- Stars
- 373
- Forks
- 60
- Open issues
- 1
- Last commit (this folder)
- Sep 23, 2026 (1 month ago)
- Last release
- Jun 8, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/OneWave-AI/claude-skills
- Website
- www.onewave-ai.com
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from OneWave-AI
- 0.625score
scout-pro
OneWave-AI
Enhanced skill navigator that maps conversation history, recommends multi-skill chains, identifies patterns from past usage, and learns from session outcomes.
SkillAFreshness: A★ 373Claude Code +9 - 0.623score
gillby-water
OneWave-AI
Plan Florida boating, fishing, paddling, surf and beach outings using Gillby's sourced marine forecasts, tides, coastal places and vessel-aware tools.
SkillAFreshness: A★ 373Claude Code +9 - 0.620score
scout
OneWave-AI
Analyzes current conversation context to recommend the best skills and subagents for the task at hand.
SkillAFreshness: A★ 373Claude Code +9 - 0.592score
database-schema-designer
OneWave-AI
Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
crm-data-cleanup
OneWave-AI
Cleans up CRM data from HubSpot, Salesforce, Pipedrive, Zoho, Close, Attio, or any CRM CSV export.
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
bookkeeping-close
OneWave-AI
Runs small and midsize business bookkeeping operations - categorizes bank and card transactions to a chart of accounts, reconciles a bank or card statement…
SkillBFreshness: B★ 373Claude Code +9
Cite this page
bi-measure-builder skill. Agent Mart. https://agentmart.dev/skills/onewave-ai-bi-measure-builder (last updated 2026-10-24)