Sub topic 15
How the Three Views Work Together
This chapter assumes you have installed Power BI Desktop, loaded a dataset with Get data, and opened Report, Table, and Model views at least once. It also assumes you know what a table, a column, and a relationship are. Here you will see how the three views connect, which view to use for which task, and the errors that appear when you work in the wrong one.
One model, three windows
Report, Table, and Model views are not three separate files or three copies of your data. They are three windows onto one semantic model. The model holds the tables, columns, data types, relationships, and measures. Each view shows a different part of it and lets you change a different part of it.
| View | Main question it answers | What you usually change there |
|---|---|---|
| Report | How should this look to the reader? | Visuals, pages, filters, formatting |
| Table | What is actually in this data? | Column data types, formats, sort order, new columns and measures |
| Model | How do the tables relate? | Relationships, cardinality, cross-filter direction, hidden fields |
Because the model is shared, a change made in one view is visible in the others straight away. You do not save or refresh between views.
Following one change through all three views
The clearest way to see the connection is to make one change and watch it travel. The steps below use a Sales table with a SalesAmount column and a related Product table.
- In Table view, select the
SalesAmountcolumn. On the Column tools tab, set the data type to Fixed decimal number and the format to Currency. - Switch to Report view and drag
SalesAmountonto a card visual. The value appears with a currency symbol, because the format is a property of the column and not of the visual. - In Table view, select the
Salestable and choose New measure. Enter this formula:
Order Count = COUNTROWS(Sales)- Open Model view.
Order Countappears under theSalestable in the diagram's field list, next to the columns. - Return to Report view.
Order Countis in the Data pane, ready to drop on a visual.
The measure was created in Table view, yet it shows up in the Data pane in Report view and in the Model view diagram. Measures belong to the model, not to the view where you typed them.
A measure like the one below behaves the same way. It can be created from any of the three views, and it is available to every visual after that.
Total Sales = SUM(Sales[SalesAmount])Relationships decide what visuals show
Relationships are the clearest case of Model view changes that alter Report view results. Suppose a table visual shows Product[Category] beside Total Sales. If no relationship joins Product to Sales, every category displays the same number. That number is the total for all of Sales, because nothing tells the model how to filter sales by category.
After you drag Product[ProductKey] onto Sales[ProductKey] in Model view, the visual changes with no edit in Report view. Each category now shows only its own sales.
Three relationship properties matter for this behavior:
- Cardinality is the relationship type. The usual one is one-to-many: one row in
Productmatches many rows inSales. The "one" side must hold unique values. - Cross-filter direction sets which way a filter flows. With Single, the one side filters the many side. With Both, the filter also flows back, which can produce surprising totals and slower queries.
- Active or inactive controls which of several relationships between the same two tables the model uses by default.
Choosing the right view for a task
Use the view that shows the cause of a problem, not the view where you noticed the symptom. Many beginners try to fix a wrong number inside Report view, when the fix belongs elsewhere.
| Symptom in Report view | Likely cause | View to fix it in |
|---|---|---|
| Every category shows the same total | Missing or inactive relationship | Model view |
| A numeric field appears as a count or as text | Wrong data type | Table view |
| A column gets summed when it should not | Summarization set to Sum on an ID or year column | Table view (Column tools) |
| Months sort alphabetically | No sort-by-column set | Table view |
| A field list is cluttered with key columns | Helper columns are visible | Model view (hide in Report view) |
| Values are null or the data is dirty | Problem before loading | Power Query Editor |
Where the views stop
Each view has limits, and knowing them saves time.
- Table view shows loaded data only. It displays the rows after Power Query steps ran. If a value looks wrong there, the cause may be a transformation step, so check Power Query Editor under Transform data.
- Table view does not edit values. You can change a column's type and format, but you cannot type over a cell as in Excel. Fixing a value means changing the source or adding a Power Query step.
- Model view does not show data. It shows structure. To check whether a relationship has duplicate keys, look at the column in Table view.
- Report view cannot repair the model. You can build a measure there, but you cannot reshape the data or fix a relationship from the canvas.
Common errors that cross views
- "The relationship cannot be created because each column contains duplicate values." The "one" side key has repeated values. Open Table view on that table and check the key column for duplicates, or clean it in Power Query Editor.
- Blank rows appear in a visual. A row in
Saleshas a key with no match inProduct. Power BI adds a blank group for the unmatched values. Find the unmatched keys in Table view. - A measure shows the wrong total after a relationship change. Check the cross-filter direction in Model view first, because measures follow the filters the model gives them.
- A new column is missing from visuals. The column may be hidden in Model view, or it may have been created in Table view on a different table than you expected.
Working order that avoids rework
A reliable order mirrors the way data flows through the model:
- Load and clean data (Get data, then Power Query Editor if needed).
- Check types and formats in Table view.
- Define relationships in Model view.
- Create measures.
- Build visuals in Report view.
You will still move back and forth. Building a visual often reveals a type or relationship problem. That is normal, and it is the reason the view switcher on the left side is always one click away.
Exercise
A table visual in Report view shows Product[Category] next to Total Sales, and every category displays the same number. Which view do you open first to investigate, what do you look for, and why does fixing it there change the visual without editing the visual?
Show answer
Open Model view first. Look for a relationship between Product and Sales, and check that it is active, that its cardinality is one-to-many with Product on the one side, and that the key columns match. Without a working relationship the model cannot filter Sales by category, so each category shows the full Sales total. The visual reads from the shared semantic model, so once the relationship exists, the visual returns filtered results with no change to the visual itself.
Exercise
You create the measure Order Count = COUNTROWS(Sales) in Table view. Name two other places where it is now available, and explain why.
Show answer
It is available in the Data pane in Report view, where you can drop it on a visual, and in the Sales table's field list in Model view. Measures belong to the semantic model, which all three views share, so the view where you created it does not matter.