bi-measure-builder
БесплатноЗапускает вложенные скриптыНе проверенWrites, explains, debugs, and optimizes BI calculations - Power BI / Fabric DAX measures and calculated columns, Tableau calculated fields…
от bankgpt104 установки в других каталогахОб этом скилле
BI Measure Builder
BankGPT Info: Smart Financial Data Management for SMEs.
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
- 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.
- 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_periodsupport). - 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.
- Write the calculation from the matching pattern in the reference file. Use variables (DAX
VAR) for readability and to evaluate each sub-expression once. - 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.
- 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. - 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 diff |
Установить bi-measure-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл 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?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bi-measure-builder запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic