Sub topic 11
Touring Model view
This chapter assumes you have installed Power BI Desktop, loaded at least two tables with Get data, and can switch views with the left-hand view switcher. Model view shows how your tables connect. It does not show the data rows themselves.
What Model view shows
Select the third icon in the view switcher to open Model view. The canvas displays each loaded table as a card. A card lists the table's columns, and the card header carries the table name. Lines between cards are relationships.
The main parts of the view are:
- Diagram canvas: the area where table cards sit. You can drag cards to rearrange them. Moving a card changes only the layout, not the model.
- Relationship lines: each line joins two columns in two tables. Symbols at each end show the cardinality, which is how many rows on one side can match rows on the other side.
- Data pane: the same field list you see in the other views.
- Properties pane: details for whatever you select, such as a table, column, measure, or relationship.
- Layout tabs: the tabs at the bottom let you keep several diagram layouts of the same model, for example one per subject area.
Reading a relationship line
Click a line and look at the Properties pane. Three settings matter most.
| Setting | Common value | Meaning |
|---|---|---|
| Cardinality | Many to one (*:1) | Many rows in the first table match one row in the second. |
| Cross-filter direction | Single | A filter flows from the "one" side to the "many" side. |
| Make this relationship active | On | Only one active relationship can exist between two tables at a time. |
A solid line is an active relationship. A dashed line is inactive, so it does nothing unless a DAX measure activates it explicitly. The small arrowhead in the middle of the line points in the direction filters travel.
Creating and editing relationships
Power BI often detects relationships when you load data. It looks for matching column names and compatible data types. You can also make one yourself:
- Drag a column from one table card onto the matching column of another card.
- Double-click the new line to open the Edit relationship dialog.
- Check the two columns, the cardinality, and the cross-filter direction.
- Select Save.
Alternatively, choose Manage relationships on the ribbon to see every relationship in one list. This is faster when a model has many tables.
Common errors
- Wrong data types: a relationship will not form between a text column and a whole-number column. Fix the type in Table view or Power Query Editor first.
- Duplicate keys on the "one" side: if a column marked "one" contains repeated values, Power BI rejects it or switches to many-to-many. Check that the key is unique.
- Blank rows in visuals: sales rows with a key that has no match in the other table appear under a blank category.
- Unexpected inactive lines: a second relationship between the same two tables is created as inactive. This is normal for role-playing dates, such as order date and ship date.
Measures in Model view
Measures appear in the Data pane here too. Defining one in any view makes it available everywhere. For example, this measure counts rows in the Sales table:
Order Count = COUNTROWS(Sales)Exercise
In Model view, a relationship line between Sales and Product is dashed. What does that mean, and how can you still use it?
Show answer
A dashed line is an inactive relationship. It does not filter by default. You can use it by calling it from a DAX measure with USERELATIONSHIP, or by making it the active relationship, which requires deactivating the other active one between the same tables.