Modelling: relationships and the star schema
Listen to this lesson
Nigerian voice narration
Fictional training case. The billing table has thousands of rows, and every row repeats the district's name, region and tariff details. Headquarters also sends a separate small table of district targets. To analyse billing against targets, the two tables must be linked. This lesson teaches data modelling — the concept that separates dashboard builders from spreadsheet users.

Fact and dimension tables
A fact table holds events or transactions — one row per bill: account, district code, consumption, billed, paid. A dimension table holds descriptions — one row per district: code, name, region, target. Facts are long and numeric; dimensions are short and descriptive.

Try it yourself — step by step
- Load disco_billing as the Billing fact table, plus District, Tariff and Month lookup tables.
- Click the Model view icon on the left.
- Drag District from the District table onto Billing[District]; repeat for Tariff and Month.
- Confirm the line shows 1 to * (one-to-many) and single direction.
Keys and relationships
A primary key uniquely identifies each dimension row (DistrictCode). The fact table carries the same code as a foreign key. In Model view, drag DistrictCode from the dimension to the fact table and Power BI creates a one-to-many relationship — one district, many bills.
The star schema
One fact table in the centre, dimension tables around it like points of a star: Districts, Tariffs, Calendar. This shape filters cleanly — click a region and the facts narrow correctly. Avoid connecting fact tables directly to each other; connect them through shared dimensions.

Build the prompt from three phrases — Role, Task and Format — and watch the AI answer.
Why not one giant table?
A single flattened table repeats every district's details on every bill row — bigger file, harder updates, contradictory spellings. The star keeps each fact once and each description once. It feels like extra work; it pays off the first time anything changes.
Common mistakes to avoid
The most common mistake is skipping the model and flattening everything into one giant table, which duplicates every district's details on every row and makes updates painful. Another is connecting fact tables directly to each other instead of through shared dimensions, which produces wrong totals that look right. A third is creating a relationship on a column with duplicates on both sides — the dimension's key must be unique, so check it first.
Your practice
Create a small Districts table in Excel (code, name, region, monthly target) and import it alongside the billing data. In Model view, create the relationship on district. Then build a table visual of billed versus target by district — the moment it works, modelling will click.
You are a data modelling tutor. Explain fact tables, dimension tables, primary keys, foreign keys and star schema using a DisCo billing database as the example, in simple terms with a small diagram in text.
Answer all three questions and check your answers to unlock the next lesson. Pass mark: 2 of 3.
A foreign key is…
One-to-many in this scenario means…
Fact tables should connect to each other…
