Skip to main content

Lesson 8 — Modeling Gold for analytics

What you'll be able to do: explain the star schema, and read a model.yaml that turns clean Silver tables into a report-ready semantic model.

Gold is where the platform stops being "clean data" and becomes "answers to business questions." It's different in kind from Bronze and Silver: it isn't generated per source table, it's generated from a model you design.

The idea — the star schema

Analytics almost always asks one shape of question: "some measurement, sliced by some attributes." Total sales by product category, by month, by customer region. The star schema is the data shape built for exactly that question, with two kinds of table:

  • Facts — the measurements. Rows of numbers you add up: a sale, an order line, a transaction. Usually many, and growing.
  • Dimensions — the things you slice by. The descriptive context: the product, the customer, the calendar. Usually fewer, and more stable.

Draw a fact in the middle with dimensions around it, joined to it, and you get a star — hence the name. It's optimized for slicing measurements by context, which is what every dashboard does.

In EasyFabric — model.yaml

You describe the star in Models/.../model.yaml, and EasyFabric generates a semantic model (the "brain" that tells Power BI how tables relate). Here's the demo's sales model, trimmed:

- Table:
Name: Verkopen # "Sales" — the FACT
TableType: Fact
SourceTable: f_verkopen
References: # the joins that make the star
- Table: Product
- Table: Kalender
- Table: Klant
Columns:
- SourceColumn: Quantity
Type: decimal(21,5)
IsHidden: true
Measures:
- Name: Totaal Verkoop # "Total Sales" — a calculation
Expression: SUM(Verkopen[Quantity])
FormatString: "#,##0.00"

- Table:
Name: Klant # "Customer" — a DIMENSION
TableType: Dim
SourceTable: d_klant
Columns:
- SourceColumn: firstname
Type: varchar(255)
- Name: Volledige naam # a calculated column
Expression: Klant[firstname] & " " & Klant[lastname]

Three things to notice, each mapping to a concept above:

  • TableType: Fact vs Dim — you declare which role each table plays. That's the star, expressed as metadata.
  • References — the fact points at its dimensions. These become the relationships in the semantic model; EasyFabric wires them so Power BI knows how a sale connects to its customer, product, and date.
  • Measures — reusable calculations (like SUM(...)) defined once in the model, so every report uses the same definition of "Total Sales." No more three dashboards disagreeing on a number.

The tables here (f_verkopen, d_klant, …) are the Silver tables from earlier lessons, now joined into a star. That's the whole medallion paying off: raw → clean → modeled for the question.

Go deeper

The star-schema concepts each have a page — Star schema, Facts, Dimensions, Keys. The model syntax starts at Tabular model. The tabular-developer skill edits model.yaml for you.

Check your understanding

Is "revenue amount per order line" a fact or a dimension? What about "the customer's country"? Why?
  • Revenue amount is a fact — it's a measurement you add up.
  • Customer's country is a dimension attribute — it's descriptive context you slice by.

Test: if you'd SUM it, it's fact-like; if you'd group or filter by it, it's a dimension.

Why define "Total Sales" as a measure in model.yaml rather than letting each report author write their own SUM?

So there's one definition everyone shares. Defined once in the model, every report and every user gets the identical calculation — no drift, no three dashboards quietly disagreeing. Centralizing the business logic in the model is the same "single source of truth" instinct as the rest of EasyFabric.

Where do the fact and dimension tables in the model actually come from?

From the Silver layer. Gold joins clean Silver tables into the star. So the model doesn't clean data — it arranges already-clean data for analysis. Each medallion layer keeps its one job.

Recap

  • Analytics asks "measurement sliced by context" → the star schema: facts (numbers you sum) surrounded by dimensions (things you slice by).
  • model.yaml declares Fact/Dim tables, References (relationships), and Measures (shared calculations); EasyFabric generates the semantic model for Power BI.
  • Gold arranges clean Silver data for the question — it doesn't re-clean it.

Next: ship it — Deploying with Azure DevOps →