01.3Excel sees rows, Power BI sees columns
In Excel, you think in rows. A row is a customer, a sale. Power BI stores and filters data differently, and this difference explains many results that will surprise you later.
01.3.1In Excel, the row is a whole
Take a list of the dealership’s customers, with the customer ID, name and city of each one. Orvane’s row brings together C001, Orvane and New York. You read it at a glance.
When you start out in DAX, you keep this habit. C001 and Orvane point to the same customer, so filtering on one or the other should come to the same thing.
In Excel too, a filter sits on a column. But what you keep in mind is the row. You are looking for “the customer Orvane,” whatever column you find it through.
01.3.2Power BI stores columns separately
Power BI doesn’t keep a customer as a whole. It keeps a “Customer ID” column, a “Name” column and a “City” column, each stored on its own with its own values. The engine that holds the tables in memory, VertiPaq, reads columns, not rows. A row still stays connected, through the position of its values. The animation shows this, then the next section.
A filter, though, most often sits on a single column, and never on “the customer” in general. You will see later that a filter can also target several columns at once, with TREATAS on two columns or FILTER on a table. Even then, it points to specific columns, not to “the customer” as a whole.
01.3.3Position connects the columns
In a table, every column keeps its values in the same order. The first value of “Customer ID,” of “Name” and of “City” belongs to position 1, the second to position 2, and so on.
So C001, Orvane and New York sit at position 1 in their columns. That position is what connects them, and what lets Power BI rebuild a customer’s row.
- A filter sits on a column and picks values from that column. “Name” = Orvane picks the value Orvane.
- The position then serves as a marker. Power BI follows Orvane’s position to find, in the other columns, the values that go with it, here C001 and New York.
01.3.4Two filters on two columns
A visual that lists its rows by “Customer ID” and by “Name” places, on Orvane’s row, two filters on the Customers table, one per column. Each filter stays attached to its column, and Power BI keeps the rows that meet both.
- If you remove the “Customer ID” filter, the “Name” filter stays in place and still keeps Orvane’s row. Removing one filter doesn’t remove the other.
- If two customers were named Orvane, the name filter would keep both of them, because it only looks at the “Name” column.
The tables themselves are connected by a relationship, on a shared column like “Customer ID.” The rows kept in Customers then filter the Sales table. Relationships are explained later.
Later, you will see that filter modifiers, like ALL or REMOVEFILTERS, take this into account. Naming a column replaces only the filter on that column.
Storing data by column has another advantage. A column that repeats the same values often, like a city, takes up very little memory. It is one of the reasons for keeping customers apart from sales.
Quiz
The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.
Question 1
In Power BI, what connects “C001” in the “Customer ID” column and “Orvane” in the “Name” column?
Question 2
A visual by “Customer ID” and by “Name” shows Orvane’s row, C001. How many filters does this row place on the Customers table?
Question 3
On this row, the filter on the “Customer ID” column is removed. What is left?
Question 4
Two different customers, C001 and C008, are both named Orvane. What does a filter “Name” = Orvane keep?
- In Excel, you think in rows. In Power BI, each column is stored separately.
- In a table, each value has a position, and the position connects the columns of the same row.
- A filter most often sits on a single column, sometimes on several specific columns, never on “the customer” in general.
- Each filter stays attached to its column. Removing the customer ID filter doesn’t remove the name filter.