Power BI Course
Model View Basics
Loading data into Power BI is only half the job. The other half is telling Power BI how your tables are connected — which column in one table links to which column in another. This structure is called the data model, and getting it right before you build a single visual is what separates reports that work from reports that silently give wrong answers.
What Is a Data Model?
In most real reports you have more than one table. An orders table has order rows. A customers table has customer details. A products table has product names and categories. These tables are separate — but they share columns that link them together. The data model is the map of those links.
Without a model, Power BI treats each table as a complete island. A bar chart showing Revenue by Customer Name is impossible if Revenue lives in Orders and Customer Name lives in Customers — unless a relationship connects them. The relationship is how Power BI knows that CustomerID in Orders refers to the same customers as CustomerID in the Customers table.
Opening Model View
Model View is the third icon in the View Switcher on the left side of Power BI Desktop — it looks like three connected rectangles. Click it and you see your tables laid out as boxes with lines connecting them. Each box shows the table name and all its columns. Each line represents a relationship.
Primary Keys and Foreign Keys
Every relationship connects two columns — one from each table. The column on one side is a primary key and the column on the other side is a foreign key. Understanding these two terms is the entire foundation of data modelling.
Relationship Cardinality
Cardinality describes how many rows on each side of a relationship can match each other. Power BI displays this as numbers and asterisks on the relationship line. Getting cardinality right is not optional — the wrong cardinality setting causes incorrect filter behaviour and wrong aggregation results.
| Cardinality | What it means | Real example | Use this? |
|---|---|---|---|
|
One-to-Many (1:*)
Most common
|
One row in Table A matches many rows in Table B. The "one" side has unique values (primary key). The "many" side has repeating values (foreign key). | One Customer → Many Orders. One Product → Many Order Lines. One Date → Many Transactions. | Always preferred |
|
One-to-One (1:1)
Rare
|
One row in Table A matches exactly one row in Table B. Both sides have unique values. Both columns are effectively primary keys. | Employee table ↔ Employee Details table where both use the same EmployeeID with no repeats on either side. | OK — usually merge instead |
|
Many-to-Many (*:*)
Avoid unless necessary
|
Many rows in Table A match many rows in Table B. Neither side has unique values. Power BI allows this but it produces ambiguous filter results and unexpected totals. | A student can enrol in many courses, and each course has many students. A product can belong to many categories and each category has many products. | Avoid — redesign model |
Filter Direction
Every relationship has a filter direction — it controls which table passes filters to which. This is shown in Model View as an arrow on the relationship line. Understanding filter direction is critical for building correct slicers and cross-filtering between visuals.
Products → Orders
Calendar → Orders
Creating a Relationship Manually
Power BI attempts to auto-detect relationships when you load tables — if two tables both have a column named "CustomerID" with matching types, it draws a line automatically. But auto-detection is not always right, and you will often need to create or edit relationships yourself.
| OrderID | CustomerID | Revenue |
|---|---|---|
| 1001 | C101 | $1,200 |
| 1002 | C102 | $350 |
| 1003 | C101 | $85 |
| CustomerID | CustomerName | Region |
|---|---|---|
| C101 | Alice Brown | North |
| C102 | Bob Singh | South |
| C103 | Carol Lee | East |
Star Schema — The Right Way to Structure a Model
The star schema is the standard structure for Power BI data models. It has one central fact table surrounded by dimension tables connected to it. Every professional Power BI model is built around this pattern — and once you understand it, you will recognise it in every report you ever open.
Star Schema rules — memorise these:
1. One fact table at the centre
- Contains numeric measures: Revenue, Qty, Cost, Clicks
- Contains foreign keys: CustomerID, ProductID, Date
- Has many rows (thousands to millions)
2. Dimension tables surround the fact table
- Each has a primary key (unique, no nulls)
- Connected to the fact table with a 1:* relationship
- Filter direction: from dimension TO fact (single direction)
- Has few rows compared to the fact table
3. Relationships only go from dimension to fact
- Customers (1) → Orders (*)
- Products (1) → Orders (*)
- Calendar (1) → Orders (*)
4. Dimension tables do NOT connect to each other
- Do not draw a line from Customers to Products
- Cross-filtering between dimensions happens
automatically through the fact table
5. No calculated columns in fact tables as relationships
- Always relate on the raw key columns, never on
columns created with DAX formulas
Common Model Mistakes to Avoid
Teacher's Note: You will often hear the term "flat table" — a single wide table where everything is crammed into one place (CustomerName, ProductName, Region, Revenue all in one table). Flat tables feel simple but they break DAX, cause massive data redundancy, and make building correct totals nearly impossible. Always split your data into a star schema before building your report. The few minutes it takes to set up relationships correctly save hours of debugging wrong numbers later.
Practice
Practice 1 of 3
In a star schema, the central table that contains one row per transaction and holds numeric measures like Revenue and Quantity is called the ___ table.
Practice 2 of 3
A column that contains unique values and identifies each row in its table is called a primary ___. The corresponding column in the related table that references it is called a foreign ___.
Practice 3 of 3
In a one-to-many relationship, filters flow from the ___ side (the dimension table) to the ___ side (the fact table) in single-direction mode.
Lesson Quiz
Quiz 1 of 3
You create a relationship between Orders.CustomerID and Customers.CustomerID. Power BI marks it as a many-to-many relationship instead of one-to-many. What is the most likely cause?
Quiz 2 of 3
A slicer filtering by Product Category does not affect the Revenue total shown by a chart pulling from the Orders table. Both tables are loaded. What is the most likely reason?
Quiz 3 of 3
In a well-designed star schema, which of the following relationship structures is correct?
Next up — Lesson 12 moves into Report View Basics — how the report canvas works, how to add and arrange visuals, how pages work, and how to build your first complete page from a connected data model.