Sub topic 18
Diagnosing wrong totals and empty visuals
This chapter assumes you know how to create relationships, set cardinality and cross-filter direction, and read the Model view. It turns that knowledge into a checklist for debugging numbers that look wrong.
Start with the symptom
Most relationship problems show up in one of a few ways. Match the symptom to the likely cause before you change anything.
| Symptom | Likely cause | Where to look |
|---|---|---|
| Every row shows the same total | No relationship, or a relationship that is not filtering | Model view: is there a line between the tables? |
| A visual is empty | Inactive relationship, wrong filter direction, or mismatched key values | Relationship line style and arrow |
| A "(Blank)" row appears with a value | Fact keys with no match in the dimension | Key values on both sides |
| Totals are too high or duplicated | Wrong cardinality, or duplicate keys on the "one" side | Column profiling and cardinality |
| Slicer does not narrow another slicer | Single-direction filtering | Cross-filter direction |
| Error about ambiguous paths | Two active routes between the same tables | Active and inactive relationships |
A repeatable diagnostic path
Work through the questions in order. Each one rules out a whole class of causes.
Check for unmatched keys
A "(Blank)" row in a visual means some fact rows have a key that does not exist in the dimension. Power BI groups those rows under blank instead of dropping them. This measure counts them:
Unmatched Sales Rows =
COUNTROWS (
FILTER ( Sales, ISBLANK ( RELATED ( Product[ProductKey] ) ) )
)RELATED returns blank when no dimension row matches. If the result is above zero, add the missing dimension rows or correct the keys in the source.
Check for duplicates on the "one" side
If a dimension key is not unique, Power BI cannot create a valid one-to-many relationship. It may fall back to many-to-many, which hides the problem and can inflate totals. Open the dimension table in Table view and compare the row count with a distinct count of the key.
Duplicate Keys =
COUNTROWS ( Customer ) - DISTINCTCOUNT ( Customer[CustomerKey] )Anything other than zero needs fixing in Power Query or at the source.
Check the details that look right but are not
- Data types: a text key such as "001" does not match a whole-number key 1. Make both columns the same type.
- Case and spaces: trailing spaces make keys differ even when they look identical.
- Filters on the visual or page: a filter on a dimension column can remove every fact row.
- Measure logic:
CALCULATEwithALLorREMOVEFILTERScan ignore a relationship on purpose.
Exercise
A Sales by Category visual shows one "(Blank)" category with a large amount. Which two checks do you run first, and what do they tell you?
Show answer
First, check that a relationship exists between Sales and Product on the key columns and that it is active. Second, run a measure such as Unmatched Sales Rows to count sales rows whose ProductKey has no match in Product. A count above zero confirms that unmatched keys cause the blank category.