Sub topic 2
Finding Your Way Around the Model View
This chapter assumes you can open Power BI Desktop, load tables from a source, and build a basic visual with a slicer. You should also know what a measure such as a sum of a column is. Here you learn the layout of the Model view, where relationships appear, and how to read the model before you change anything.
Why the Model view matters
Report visuals get their numbers from the model, not from the visuals themselves. The Model view shows that model: the tables, their columns, and the relationships between them. When a total looks wrong, this is the first place to check. You will return to this view in almost every later chapter.
Power BI Desktop has three main views, listed down the left edge of the window.
| View | Icon purpose | What you do there |
|---|---|---|
| Report | Page canvas | Build visuals and slicers |
| Table (Data) | Grid of rows | Inspect the loaded rows and values |
| Model | Boxes joined by lines | Inspect and edit tables and relationships |
Select the Model icon, the one that looks like three connected boxes. Which icons appear can vary with your version and settings, so look for the diagram icon rather than relying on its position.
The parts of the Model view
The Model view has four areas you will use constantly.
- The canvas. The large central area. Each table is a box, and each relationship is a line between two boxes.
- Table boxes. A box has a header with the table name and a list of its columns. Measures show with a calculator icon, and hierarchies have their own icon.
- The Properties pane. It opens on the right when you select a table, column, or relationship. It shows details and some editable settings.
- Layout tabs. Along the bottom you will find tabs such as All tables. You can add tabs to hold a subset of tables, which is useful in large models.
Reading a relationship line
A relationship is drawn as a line connecting two tables. The line carries three pieces of information, and you should learn to read them at a glance.
- The ends. A
1at one end means that side holds unique values. An asterisk (*) at the other end means the many side, where values can repeat. - The arrowhead. A small arrow in the middle of the line shows the cross-filter direction. A single arrow means filters flow one way. Two arrows mean both directions.
- The line style. A solid line is an active relationship. A dashed line is an inactive one.
The following diagram shows a typical model as the Model view would draw it.
The arrows point from the dimension tables toward the fact table. That matches how filters travel by default: a selection on a dimension narrows the rows of the fact table. The later chapters on cross-filter direction and filter propagation explain this in detail.
Reading the layout
Power BI does not arrange tables for you in a meaningful way. Where a box sits on the canvas has no effect on calculations. Even so, a tidy layout makes problems easier to see.
A common convention is to place the fact table in the middle and the dimension tables around it. Doing so gives you the familiar star shape. A model that looks like a tangle of crossing lines is often a sign of a design problem, such as a chain of tables or several paths between two tables.
Useful layout actions:
- Drag a table header to move the box.
- Drag a box edge to resize it, so that more columns show.
- Right-click the canvas and choose an option such as Select related tables to find the neighbors of a table.
- Use the zoom controls at the bottom right to fit the whole model on screen.
Inspecting a table and its columns
Click a table header and look at the Properties pane. You can see the table name and, depending on your version, settings such as storage mode. Click a column to see its name, data type, format, and summarization setting. Check the data type early. The next chapter on key columns explains why two columns with different types cannot be reliably related.
A column's summarization setting can matter in the Model view. If a numeric key column such as CustomerKey is set to Sum, Power BI may add it up when you drop it in a visual. Setting its summarization to Don't summarize avoids that mistake.
Selecting a relationship
Click a relationship line. Two things happen.
- The line is highlighted, and the two related columns are highlighted in their tables.
- The Properties pane shows the settings for that relationship: the two tables and columns, the cardinality, the cross-filter direction, and whether the relationship is active.
This is the fastest way to see which columns are joined. Highlighted columns tell you the key on each side without opening a dialog.
You can also hover over a line to see a summary of the relationship. Double-clicking the line opens the Edit relationship dialog. The later chapter on creating and editing relationships covers that dialog fully.
Manage relationships as a second view of the same information
The Model view is graphical. The Manage relationships dialog shows the same relationships as a list. To open it, use the Manage relationships button on the Home tab of the Model view ribbon. Each row shows the from table, the to table, the columns, and whether the relationship is active.
The list is better when the model has many tables, because lines can overlap on a busy canvas. Use the canvas to understand shape, and the list to audit every relationship quickly.
| Task | Canvas | Manage relationships list |
|---|---|---|
| See the overall shape | Best | Poor |
| Spot a missing relationship | Good | Good |
| Audit many relationships | Hard when crowded | Best |
| See cardinality and direction | Symbols on each line | Columns in the list |
Common mistakes when reading the Model view
- Assuming no line means no connection. Two tables may be connected indirectly through a third table. Follow the lines across the whole model.
- Assuming a line means a working filter. An inactive relationship is drawn as a dashed line and does not filter by default.
- Ignoring hidden items. Columns or tables can be hidden from Report view. They still exist in the model. Hidden key columns are common and are a good practice, but they can make you miss a relationship if you only look at report fields.
- Treating position as meaning. A table placed above another does not mean it is the "parent" in any technical sense.
A quick audit routine
When you open an unfamiliar model, run through this short routine before you write any measure.
- Identify the fact tables, usually the ones with many rows and numeric columns.
- Identify the dimension tables, usually the ones with descriptive columns and unique keys.
- Click each line and note the key columns, the cardinality, and the direction.
- Look for dashed lines, which are inactive relationships.
- Look for double arrows, which are both-direction filters.
- Look for tables with no lines at all.
A table with no lines is not automatically wrong. A table of parameters or a measures-only table is often isolated on purpose. A dimension table with no lines to a fact table, however, will not filter anything, and that is a frequent cause of slicers that appear to do nothing.
Exercise
You open a model and see a line between Product and Sales with a 1 on the Product end, an asterisk on the Sales end, a single arrow pointing toward Sales, and a dashed style. Describe what the line tells you.
Show answer
It is a one-to-many relationship, with Product as the one side (unique keys) and Sales as the many side. Filters flow from Product to Sales. The dashed style means the relationship is inactive, so it does not filter by default. A measure must activate it, for example with USERELATIONSHIP, or the relationship must be made active.
Exercise
A colleague moves the Date table box to the far corner of the canvas and says this broke the report. Is that plausible?
Show answer
No. Box position is purely visual and does not change relationships or calculations. If the report changed, something else was edited, such as a relationship, a column type, or a measure.