Webbo3 Power BI · Cohort 1 · Day 9 of 16 · Lab
Day 9 Lab: Relationships in Model View and First Measures
The Webbo Oil model wired up by the whole class, and a first page of measures everyone can check.
By the end of today you can
- Build and inspect every relationship in Model view
- Recognise a wrong relationship from what the visuals show
- Write the first page of Webbo Oil measures and check them against the class
- Use a measure with any dimension: year, station, product, attendant
- Start Assignment 2 with a model that works
Two days of theory, now one working model. Same lab rules: every number on the checkpoint list must match before the class moves on.
1. Wiring the Model Together
Definition
Model view shows every table as a card. A line between two cards is a relationship; the 1 and * at its ends show which side is one and which is many; the small arrow in the middle shows which way filters travel.
Real-Life Example
Plumbing. Every pipe must connect the right two points, and the water must flow the right way. A pipe to the wrong tap is worse than no pipe: it looks connected.
The class build
Wrong Relationships, and What They Look Like
Each mistake below was made by somebody in a real class. Learn the symptom; the cause follows.
| Symptom | Cause | Fix |
|---|---|---|
| One (Blank) row holding the whole total | Relationship on columns whose values never match | Delete it; relate Sales[StationName] to Station_Master[StationName] |
| The same number on every row | No relationship between the two tables | Draw it |
| A dotted line | The relationship is inactive, usually because a second path exists | Remove the extra path (for example Attendant_Directory to Station_Master) |
| A small (Blank) row next to the real ones | Some keys in Sales match nothing | Left Anti merge in Power Query to find them (Day 5) |
Picture the plumber checking each pipe runs to the right tap, before turning the water on.
2. The First Page of Measures
Definition
A measure page is a report page of cards and tables whose only job is to check the measures are right before anything pretty is built. Analysts build one in every project.
Real-Life Example
A chef tastes every sauce before plating. The tasting spoon is not for the customer, and skipping it is how a salty dish reaches the table.
Measures from Day 8, typed again from memory
Revenue grew about 56% from 2023 to 2024 while the number of sales barely moved. The growth is price: petrol cost about ₦185 a litre in early 2023 and about ₦900 by late 2024. A finding like that is why you split every measure by year before you trust it.
To show only the top five in Power BI: select the table visual, Filters pane, AttendantName, Filter type: Top N, Show items: Top 5, By value: Total Revenue, Apply filter. Then untick (Blank) in the same filter card: those are the unmanned sales, and no attendant earned them.
Add Product_Master[Category] as a slicer on the measure page and click Fuel. Every card and table should change together. If one does not, its relationship is missing.
Picture the chef's tasting spoon: every sauce checked before it goes near a plate.
3. Assignment 2 Is Released
Assignment 2 asks you to build this whole model yourself, from the raw files, and to explain it. It is due on Day 11.
The full brief is on the Assignment 2 page, the next lesson in this course.
Do This Now
- Check your four relationships in Manage relationships.
- Break one on purpose (relate Station to StationID), look at the symptom, then fix it.
- Build the measure page: four cards, the by-year table, the by-station table.
- Add the Top 5 attendants table with a Top N filter.
- Check every number against this lesson, and read the Assignment 2 brief.
Checkpoint
Q1. A visual shows one (Blank) row with the whole total. What happened?
The relationship joins columns whose values never match, so no sale finds its dimension row.
Q2. Both years show the same revenue. What is missing?
The relationship from Date[Date] to Sales[Date].
Q3. Why build a measure page before a dashboard?
To prove each measure is right under every filter while it is easy to check, before design hides the numbers.
Q4. Why did revenue grow so much more than the number of sales?
Prices rose sharply over the two years, especially petrol. Revenue grew mostly from price, not from more customers.
Tick Before You Move On
- ☐ Four relationships, all Many to one and Single
- ☐ Every card on my measure page matches the lesson
- ☐ The by-year and by-station tables split and add up
- ☐ I can name the symptom of a wrong and of a missing relationship
- ☐ I have read the Assignment 2 brief
Quick Recap
Model view lines are relationships; 1 and * show the sides; the arrow shows the filter direction. A (Blank) row holding everything means keys that never match. The same number everywhere means no relationship. A measure page checks the numbers before design begins. Split every measure by year before trusting it.
Final Scenario
Your measure page says revenue grew sharply, and the manager is delighted.
You show her the transactions column next to it: sales grew much less. You explain the price rise, and she changes her plan from "hire more attendants" to "watch pump prices". The measure page just paid for itself.
Numbers you have checked are numbers you can argue with.
Next: the Assignment 2 brief, then Day 10, CALCULATE.