Individual skill
bi-measure-builder
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.
bi-measure-builder/SKILL.md
Source commit b2267d9171af4f56848d82992381b20b89b44056
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 6, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 421
- Repository last updated
- Oct 20, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- agent-skills Repository topic
- ai-agents Repository topic
- anthropic Repository topic
- claude Repository topic
- claude-code Repository topic
- claude-skills Repository topic
- developer-tools Repository topic
- llm Repository topic
- prompt-engineering Repository topic
- sales-automation Repository topic
- operations Derived category
- testing Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 8,798 bytesSKILL.mdcore · 8,798 bytesexamples/actual_yoy_fixed.csvasset · 62 bytesexamples/actual_yoy_from_tool.csvasset · 68 bytesexamples/worked-example.mddoc · 4,595 bytesexamples/yoy_spec.jsonasset · 160 bytesreferences/dax.mddoc · 10,294 bytesreferences/looker.mddoc · 9,474 bytesreferences/tableau.mddoc · 7,774 bytesscripts/measure_check.pyruns · 8,175 bytestests/fixtures/balances.csvasset · 135 bytestests/fixtures/sales.csvasset · 278 bytestests/specs/balance_global_last.jsonasset · 326 bytestests/specs/balance_per_entity.jsonasset · 286 bytestests/specs/distinct_customers.jsonasset · 223 bytestests/specs/new_customers.jsonasset · 228 bytestests/specs/new_customers_east.jsonasset · 261 bytestests/specs/pct_region.jsonasset · 245 bytestests/specs/prior_year.jsonasset · 226 bytestests/specs/rank_customer.jsonasset · 216 bytestests/specs/returning_customers.jsonasset · 228 bytestests/specs/rolling_3m.jsonasset · 249 bytestests/specs/running_total.jsonasset · 230 bytestests/specs/yoy_pct.jsonasset · 240 bytestests/specs/ytd.jsonasset · 220 bytestests/specs/ytd_fiscal_jul.jsonasset · 262 bytestests/test_measure_check.pyruns · 1,180 bytes
Read excerpt
# 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.