Sub topic 11
Touring Model view
Model view shows the structure of your data model as a diagram. Report view is for building visuals and Table view is for inspecting rows. Model view is for seeing which tables exist, which columns they hold, and how the tables connect. This chapter tours the view and explains how to read it. The next chapter covers relationship settings in more depth.
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. It also assumes you know what a primary key is: a column whose values identify each row once.
What Model view is for
Every table you load becomes part of a data model. The model is the set of tables, columns, relationships, and measures that every visual reads from. Model view draws that set as boxes and lines.
Use Model view to:
- See all tables and their columns at a glance.
- Check whether two tables are related, and how.
- Create, edit, or delete relationships.
- Hide columns or tables from Report view.
- Organize large models into smaller diagram layouts.
Model view does not show row data. If you need to look at values, switch to Table view.
Opening Model view
Click the third icon in the view switcher on the left edge of the window. The icons run from top to bottom: Report, Table, Model. The Model icon looks like three connected boxes. Newer builds may also show a DAX query view and a TMDL view below it. You can ignore those for now.
The window then holds three areas:
- The diagram canvas in the center, where tables appear as boxes.
- The Properties pane, which shows settings for whatever you have selected.
- The Data pane on the right, which lists tables and fields as in the other views.
A tab strip at the bottom of the canvas shows the diagram layouts. A new model starts with one layout named All tables.
Reading a table box
Each table appears as a box. The title bar holds the table name. Below it is a list of columns. A few visual cues carry meaning:
- A sigma symbol marks a column that Power BI treats as numeric and summarizes by default.
- Measures, which you create with DAX, appear with a calculator icon.
- A column hidden from Report view appears grayed out, with a crossed-eye icon.
- A small icon next to the table name shows when a table is a calculated table or has a special role, such as a date table.
You can drag a box by its title bar to reposition it. The position has no effect on how the model calculates. Moving boxes only changes the picture. A good habit is to place the tables that hold facts (such as Sales) in the center and the descriptive tables (such as Product or Customer) around them.
Click a box to select it. The Properties pane then shows its name, description, and whether it is hidden. You can also collapse a box to its title bar to save space, or expand it to show every column.
Reading a relationship line
A relationship is a rule that links one column in one table to one column in another. When the model has a relationship, Model view draws a line between the two boxes. Three details on each line matter:
- The ends of the line show cardinality. A 1 marks the side where each value appears once. An asterisk (\*) marks the side where a value may appear many times.
- An arrowhead in the middle of the line shows the cross-filter direction. A single arrow means filters flow in one direction. Two arrows mean filters flow both ways.
- A solid line means the relationship is active. A dashed line means it is inactive. The model uses an active relationship by default and ignores an inactive one unless a DAX formula asks for it.
For example, a line from Product (1 side) to Sales (\* side) says that each product appears once in Product and many times in Sales. A single arrow pointing toward Sales means that selecting a product filters the Sales rows. This one-to-many pattern with a single direction is the most common and the safest.
Hover over a line to highlight the columns it connects. Double-click it to open the Edit relationship dialog.
Creating a relationship
Power BI tries to detect relationships when you load data. It looks at column names and data types. Auto-detection is a guess, so always confirm the result in Model view. There are three ways to create a relationship by hand:
- Drag a column from one table box onto the matching column in another box.
- Select Manage relationships on the ribbon, then New relationship.
- Right-click a table and choose a related action from the menu, where offered.
In the dialog, you choose a table and column on each side. Power BI proposes the cardinality and cross-filter direction. Check both before you click Save.
The matching columns should have the same data type. A text column of product codes will not match a whole-number column of product IDs. If the types differ, fix the type in Table view or in Power Query Editor first.
Working with large models: layouts and filters
A model with dozens of tables becomes hard to read as one picture. Model view lets you create extra layouts, each showing only a chosen subset of tables.
- Click the + next to the layout tabs to add a blank layout.
- Right-click a table and choose Add related tables to bring in its neighbors.
- Drag tables from the Data pane onto the canvas of a custom layout.
Layouts are only views of the same model. Removing a table from a layout does not delete it. Deleting a table from the Data pane or from the All tables layout does delete it, so check which one you are using.
The search box in the Data pane helps you find a column by name. Selecting a column there highlights it on the canvas.
Hiding tables and columns
Some fields exist only to support relationships, such as ID columns. They clutter the Data pane in Report view and invite mistakes. In Model view, right-click a column or table and choose Hide in report view. The field stays in the model and still works in relationships and formulas, but report authors no longer see it.
Hiding is not security. A hidden column is still readable by anyone who can edit the model. Use row-level security if access must be restricted.
The Properties pane
Select any object to edit its settings in the Properties pane. For a column, you can set the display name, description, data type, format, summarization, and sort order. These are the same properties you saw in Table view. The Model view gives you a faster way to change them for several columns at once. Hold Ctrl and click multiple columns, then change one setting to apply it to all of them.
Selecting a relationship line shows its cardinality, cross-filter direction, and whether it is active.
A measure shown in Model view
Measures appear inside the table where you created them. Here is a measure that counts sales rows:
Order Count = COUNTROWS(Sales)After you create it, find Order Count in the Sales box in Model view. Create it from any view. It appears in the Data pane of all three. Measures are not stored in a column, so they do not appear in Table view's grid.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| No line between two tables that should be related | Auto-detect missed them because column names differ | Drag one column onto the other, or use Manage relationships |
| Warning that the relationship is many-to-many | Neither column holds unique values | Clean duplicates in Power Query Editor, or use a dimension table |
| A visual shows the same total for every category | The tables are unrelated, or the filter flows the wrong way | Check the line and its arrow in Model view |
| Dashed line instead of solid | Another active relationship already links the same two tables | Make the intended one active, or use it in DAX with USERELATIONSHIP |
| Cannot create the relationship | Data types of the two columns differ | Change one type so they match |
| A table disappeared from a layout but remains in the Data pane | It was only removed from that layout | Drag it back from the Data pane |
Habits worth building
- Open Model view every time you load a new table. A quick check prevents wrong totals later.
- Prefer one-to-many relationships with a single filter direction. Use two-way filtering only when you can explain why you need it.
- Keep fact tables in the center of the diagram and dimension tables around them.
- Hide key columns that report authors should not use.
Exercise
In Model view you see a solid line between Product and Sales. The Product end shows 1, the Sales end shows an asterisk, and the arrow points toward Sales. What does this tell you about the data and about filtering?
Show answer
Each product appears once in Product and can appear many times in Sales (a one-to-many relationship). The relationship is active, because the line is solid. Because the arrow points toward Sales, selecting a product in a visual filters the Sales rows, but selecting a sale does not filter the Product table.
Exercise
A colleague hid the ProductID column in Model view. A report author says the relationship between Product and Sales is now broken. Is that correct, and how would you check?
Show answer
No. Hiding a column only removes it from Report view. The column stays in the model and the relationship keeps working. To check, open Model view and confirm the line between the tables is still there, then double-click it to confirm it still uses the ProductID columns.
Exercise
You need to apply the same display format to five columns in a table. What is a fast way to do this in Model view?
Show answer
Select the first column, hold Ctrl and click the other four, then change the format in the Properties pane. The setting applies to all selected columns.