Why this matters
As a BI Analyst, you define metrics, dimensions, and logic that many dashboards, reports, and stakeholders depend on. A small change to a shared definition (like Revenue or Active Users) can silently break KPIs, confuse leadership, or misalign teams. Managing shared definitions safely protects trust, reduces fire drills, and keeps data work predictable.
- Real tasks: update a metric definition (e.g., exclude refunds), rename a column used by many reports, deprecate a legacy KPI, or align logic across teams.
- Risks: broken dashboards, mismatched numbers in meetings, and time lost debugging.
Concept explained simply
Shared definitions are the single sources of truth for business logic: metric formulas, calculation filters, dimension derivations, standard SQL snippets, and semantic layer or BI model files. They are assets used by many downstream users and reports.
What counts as a shared definition?
- Metric and dimension specs in semantic layers or BI models (YAML, JSON, LookML-like files, etc.).
- SQL views or models referenced by multiple dashboards.
- Reusable CTEs, macros, or templates consumed by many queries.
Mental model: "Contracts and migrations"
Treat shared definitions like public APIs. Consumers rely on contracts (names, types, meanings). Changes should be versioned, reviewed, and migrated with backward compatibility whenever possible.
- Contract: the stable interface (names, semantics, data types, allowed values).
- Change: propose, review, test, release, communicate, migrate, clean up.
- Guardrails: PR reviews, tests, deprecation windows, and clear ownership.
Key principles and guardrails
- Prefer additive changes: add new fields/metrics instead of mutating existing ones.
- Use aliases or temporary shims to maintain backward compatibility during migration.
- Document the change plan: who is impacted, risk level, rollout steps, and fallback.
- Require peer review from data owners of impacted domains.
- Automate checks: unit tests for logic, schema tests for types/nulls, and linting for naming.
- Communicate timelines and deprecation dates. Avoid surprise Friday releases.
- Have an immediate revert plan for emergencies.
Worked examples
Example 1 — Change a metric filter safely
Goal: Update revenue to exclude refunds. Dashboards currently use revenue widely.
- Add a new metric
revenue_netwith the new logic. - Mark
revenueas deprecated and keep it unchanged for a migration window. - Communicate the change, owners, impact, and migration date.
- After migration, update
revenueto point torevenue_netor remove it if safe.
# Before (semantic.yml)
metrics:
- name: revenue
sql: SUM(order_amount)
label: Revenue
# After (additive with deprecation)
metrics:
- name: revenue
sql: SUM(order_amount)
label: Revenue (Deprecated; use revenue_net)
tags: [deprecated]
- name: revenue_net
sql: SUM(CASE WHEN refund_flag = 0 THEN order_amount ELSE 0 END)
label: Revenue (Net)
Example 2 — Rename a widely used dimension
Goal: Rename signup_date to user_signup_date for clarity.
- Add
user_signup_datewhile keepingsignup_dateas an alias that references the new field. - Tag the old name as deprecated; communicate and provide a removal date.
- Update core dashboards; leave the alias until others migrate.
# Before
dimensions:
- name: signup_date
type: date
sql: user.signup_ts::date
# After
dimensions:
- name: user_signup_date
type: date
sql: user.signup_ts::date
- name: signup_date
type: date
sql: ${user_signup_date}
tags: [deprecated]
Example 3 — Tighten a calculation without breaking consumers
Goal: Adjust active_users_7d logic from login-based to event-based activity.
- Introduce
active_users_7d_v2with event logic and add tests. - Run both metrics in parallel; compare for a period to validate stability.
- Communicate differences and update decision-critical dashboards first.
- Deprecate and later remove v1 after adoption.
Workflow: Safe change lifecycle
- Discover & scope: Define the problem, list consumers, estimate risk.
- Design: Prefer additive changes; plan aliases, deprecation window, and tests.
- Implement in a branch: Update definitions, add tests, and run CI locally if possible.
- Pull Request: Include change plan, impact list, screenshots of test results, and rollback steps.
- Review: Get approvals from data owners and an analyst who owns key dashboards.
- Release: Merge during a safe window; monitor key metrics and error logs.
- Communicate: Announce changes, timelines, and migration instructions.
- Clean up: Remove deprecated aliases after the announced date.
Exercises
Complete the exercises below. Use the checklists to self-verify. Solutions are available in collapsible panels.
- Exercise 1: Plan and implement a safe metric change with deprecation.
- Exercise 2: Add ownership, tests, and approvals to protect a shared definition.
Self-check checklist
- I used additive changes or aliases first.
- I wrote a short change plan with impacts, timeline, and rollback.
- I included tests and validated results.
- I specified who must approve the change.
- I documented deprecation dates and communicated them.
Common mistakes
- Mutating an existing definition without an alias or deprecation window. Fix: add a new name first.
- Not informing dashboard owners. Fix: list impacted assets and message owners before merging.
- Releases at risky times (end of day/week). Fix: release early in the day with monitoring.
- Missing tests. Fix: add unit logic checks and schema tests for types/nullable.
- No rollback plan. Fix: define how to revert and under what signals.
Quick self-audit before merging
- Did I avoid breaking changes or provide a temporary alias?
- Are tests passing and differences explained?
- Do the right owners approve this PR?
- Have I scheduled communication and set a clear deprecation date?
Practical projects
- Create a shared semantic file for 3 core metrics (revenue_net, orders, aov). Add owners, tags, and tests.
- Refactor one legacy dimension using an alias + deprecation pattern. Write the migration note.
- Draft a team-wide “Change Plan” template with sections for risk, impact, rollout, and rollback.
Mini challenge
You discover a KPI used in the monthly exec deck has ambiguous logic. Propose a 4-step plan to clarify and migrate it without breaking the deck. Keep it concise.
Who this is for
- BI Analysts and Analytics Engineers maintaining shared metrics/dimensions.
- Analysts who own dashboards consumed by multiple teams.
Prerequisites
- Basic Git: branches, commits, pull requests.
- Comfort with SQL and reading model/semantic files (e.g., YAML).
- Familiarity with your BI tool’s model/semantic concepts.
Learning path
- Version control basics: branching and PRs.
- Shared definitions: contracts and consumers.
- Tests and validation for metrics/dimensions.
- Change planning, deprecation, and communication.
- Release, monitor, and cleanup.
Next steps
- Adopt a lightweight change plan template for any shared-definition PR.
- Set default reviewers for high-impact files.
- Automate a minimal test suite for your top 5 KPIs.
Quick Test
Anyone can take the test for free. Only logged-in users will see saved progress and history.