Governed Subscription Metrics with dbt, Superset and Row-Level Security

Build the metrics layer behind a subscription company's dashboards: load verified billing exports, model MRR, its bridge, retention and recognized revenue in dbt on PostgreSQL, define every measure once in a validated metric catalog, and publish each daily refresh only after tests, an independent reconciliation and a closed-period check pass. Then provision Apache Superset from code, with certified metrics, dashboards and row-level security that shows each regional leader only their own region.

BI Analyst. Advanced.

What you will build and explain

  • Define MRR, the MRR bridge, net and gross revenue retention, logo churn and recognized revenue precisely, with their grain, additivity, currency rule and the edge cases that make spreadsheets disagree.
  • Model subscription billing in dbt with typed staging, type 2 account history, a fiscal calendar, contracted reporting models and generic, singular and unit tests.
  • Run a daily refresh that loads verified batches, builds into an inactive copy, reconciles against an independent calculation, holds silent restatements of closed months for approval and publishes atomically.
  • Manage a metric catalog, dashboards, roles and row-level security as reviewed code, and prove with an automated check that each viewer sees only the rows they are entitled to.
  • Diagnose a failed refresh, a restatement and a disputed number from operations records, explain the design in an interview and remove every lab resource afterwards.

Before you begin

  • SQL with joins, GROUP BY, CASE and common table expressions, and reading a window function; percentages, ratios and currency conversion
  • Reading short Python functions and YAML, using a terminal, and Docker basics (images, containers, volumes and ports)
  • A Linux, macOS or Windows (WSL 2) computer with Docker and Docker Compose, Git, at least 4 CPUs and 6 GB of memory for Docker, and about 6 GB of free disk

Who this is for

For analysts who write SQL with joins and GROUP BY and have built reports, and want to build the trusted metrics layer behind them: one definition per measure, reconciled refreshes, protected closed months and row-level security in Superset.

Curriculum

Learning topics (14)
  1. Check your starting skills and prepare your machine

    This project asks you to build what sits behind a dashboard: the data preparation, the single definition of each measure, the checks that prove the numbers, the refresh that publishes them safely and the access rules that decide who sees which rows. You will build dashboards too, but most of the work is making sure that the number on a dashboard is the right number, for the right person, as of a date you can state.

  2. Follow a number from billing export to governed dashboard

    Marrowfield's metrics layer turns daily billing exports into dashboards that Finance and the regional leaders can trust. "Trust" has four concrete parts in this design, and every component below exists to provide one of them:

  3. Define MRR, the MRR bridge and retention precisely

    Marrowfield's board pack and its EMEA forecast disagreed on EMEA net new MRR by 11%. Nobody had made an arithmetic mistake. Each spreadsheet had made a different, reasonable-looking choice: which exchange rate, whether a downgrade is churn, which day of the month counts. A trusted metrics layer starts by writing those choices down so precisely that two people, or two programs, cannot compute different answers. This lesson defines every subscription measure the project uses an

  4. Prepare billing data with dbt sources, staging models and tests

    Every number on Marrowfield's dashboards starts as a line in a CSV file from the billing system. Data preparation turns those files into tables you can trust: complete, correctly typed, with one current version of each record, and without personal data the reports do not need. This lesson covers the first two layers, the raw batches and the dbt staging models, and the tests that guard them. The next lesson builds the facts and dimensions on top.

  5. Model facts and dimensions with grains, fiscal time and history

    Staging models give you clean records. Reports need something different: tables whose rows describe one clearly stated thing, that join without multiplying rows, and that answer "what was true then?" as easily as "what is true now?". This lesson builds Marrowfield's marts: the facts, the dimensions, the fiscal calendar and the two kinds of history.

  6. Define each measure once in a validated metric catalog

    The marts hold correct columns. That is not yet enough: a dashboard author who writes AVG(logos_churned / logos_active_last_month) in a chart, or sums MRR over a quarter, still produces a wrong number from correct data. A metric catalog, often called a semantic layer, closes that gap. It defines each measure once, with its business meaning, owner and rules, and every chart uses that definition by name instead of writing its own SQL.

  7. Reconcile numbers with control totals and an independent recalculation

    Tests check rules: an ID is unique, a currency is valid, a bridge balances. They cannot tell you that a whole batch of invoice lines is missing, or that the MRR calculation has a subtle mistake that every row repeats consistently. Reconciliation answers a different question: do the numbers agree with evidence that was produced independently of them? If they do not, the refresh stops.

  8. Refresh safely with quality gates and blue/green publication

    A daily refresh is where most real-world BI trust is lost. A job that loads, transforms and overwrites the tables dashboards read has three ways to hurt people: it publishes data that fails its own checks, it publishes half a build (new MRR beside yesterday's movements) while someone is looking, and it fails quietly, so a dashboard shows last Tuesday's numbers under today's date. This lesson builds a refresh that does none of these.

  9. Protect closed periods and approve restatements

    Finance closes each month a few days after it ends. From then on, that month's MRR and revenue appear in board packs, investor updates and commission statements. If a later refresh changes a closed month's numbers, every one of those documents silently disagrees with the dashboard. Sometimes the change is right: a late credit note, a corrected region. It must still never happen without someone deciding it should, and the decision must be recorded.

  10. Control who sees which rows with roles and row-level security

    Before this project, Marrowfield's regional leaders received whole-company exports and were trusted to filter out other regions. Trust is not a control. A leader should only ever be able to see their own region, and that should be enforced by the platform for every chart, export and query. This lesson builds access in three layers and shows how to test it.

  11. Build Superset datasets, charts and dashboards from the repository

    A dashboard built by clicking in a web page has no history, no review and no second copy. When someone "fixes" a chart, nobody can say what changed, and rebuilding the BI server means rebuilding every chart by hand. This lesson treats Superset's configuration like the rest of the project: generated from files in the repository, reviewed, and applied by one command that can run any number of times.

  12. Operate the metrics layer with data health, reviews and documentation

    A metrics layer is never finished. Every morning a refresh runs, and some mornings it fails, waits for approval or warns. Every month someone asks a new question or wants a definition changed. This lesson covers the habits and tools that keep the layer trustworthy after it is built: recording what happened, showing it to the people who rely on the numbers, checking reports against real questions, and keeping documentation generated rather than written by hand.

  13. Run the lab from an empty machine to a reviewed metrics layer

    This runbook is the single source of the commands used by the build steps. Every command runs in a terminal on your own computer, in the project's source/ folder (the folder that contains compose.yaml), unless it says otherwise. Example outputs come from one lab run: run numbers, timestamps, durations and generated passwords differ on your machine, but every business number is the same, because the data generator is deterministic.

  14. Remove the lab and confirm nothing remains

    Everything this project creates lives in Docker objects named after the Compose project subs-metrics, plus one folder of generated passwords. The commands below remove exactly those and nothing else on your computer.

Practical build steps (10)
  1. Prepare secrets and images, start the warehouse and Superset

    You start with the source folder and Docker. By the end of this step you have random lab passwords in a private folder, the project's images, and two running services: the PostgreSQL warehouse and Superset. Nothing has been generated or loaded yet.

  2. Generate the billing exports and inspect a batch

    Starting from a running warehouse, you create Marrowfield's billing exports: a history batch and three daily batches, each with a manifest, and a corrected re-send that waits in the vendor outbox. Nothing is loaded yet.

  3. Run the first refresh and read every gate

    This step loads the history, builds the first candidate, checks it and publishes it. One command runs all of it, but the output is the lesson: each gate prints what it checked, how long it took and what it found. By the end, the reporting views point at analytics_blue and the data is as of 27 September 2026.

  4. Check the numbers in the warehouse

    Before any dashboard exists, check the published numbers directly. You query the MRR bridge and the retention measures through the reporting views, the same views Superset will read, and confirm that they follow the definitions: the bridge balances, each month starts where the previous one ended, and every rate is a ratio of sums.

  5. Provision Superset and open the dashboards

    With data published, one command configures Superset from the repository: the warehouse connection, ten datasets with certified metrics, eighteen charts, three dashboards, three roles, seven lab users and the row-level security filter, plus the entitlement rows in the warehouse. You run it twice to see that the second run changes nothing.

  6. Check who sees which rows

    Access rules are tested, not assumed. The access check signs in as every lab user and asks Superset the same question, then tries what a regional viewer must not be able to do. You then sign in as a regional leader yourself and compare what you see with Finance's view.

  7. Refresh day by day and approve a restatement

    Now the data moves forward one business day at a time. The first daily refresh publishes quietly. The second is held: a late credit note and a region correction change months that Finance has already closed. You read the restatement report, decide, and approve it with a reason that is recorded.

  8. Recover from a defective batch

    The first delivery for 30 September is defective: three invoice lines are duplicated and one currency is mistyped. The refresh stops at the build gate. You confirm that the dashboards still show 29 September and say that the latest run failed, then receive the vendor's corrected re-send and refresh again.

  9. Review, document and change a measure safely

    The layer is built; this step checks it the way its users will meet it. The stakeholder review asks real questions through Superset, as the people who ask them, and compares every answer with an independent query. Then you generate the data dictionary and the metric catalog page from the same files the build uses.

  10. Remove the lab

    Cleanup removes everything this project created: its containers, network, volumes (the warehouse, exports, reports and Superset's home), its images and the generated passwords. It works from any state, including a build that stopped part-way, and leaves other Docker resources on your computer alone.

Access

Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.

Cloud costs and boundaries

No cloud account, BI licence or spending is needed: the warehouse, the refresh jobs and Apache Superset run as containers on your own computer, with synthetic data for a fictional company. The first build downloads about 1.5 GB of images and packages. GitHub Actions is optional; it is free on public repositories and uses your account's included minutes on private ones. This is a learning lab, not a hosted environment or a production-readiness guarantee.

Licence and completion

Vectametric Project Source Licence (2026-09-27): lawfully obtained source may be copied, modified and deployed for personal learning and interview preparation, including personal portfolio demonstrations with attribution. These permissions continue after online access expires. Do not resell or redistribute the Source Pack or its original source files, unchanged or modified. Commercial or client production use requires separate written permission. Third-party components, such as Apache Superset, PostgreSQL, dbt-core, dbt-postgres, psycopg, PyYAML, Requests, pytest and ruff, retain their own licences. See LICENSE.txt and the Project Source Licence section of the site Terms for the full rules.

Questions about projects

Do I need a cloud account?

You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.

Can I read the code with Learning Access?

Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.

Are cloud charges included?

No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.

Does the project include troubleshooting and interview preparation?

The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.

How long can I use the project?

The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.

Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy