Forum Discussion
Unexpected Behavior Between Two Related Tables.
- 1 year ago
This usually happens because:
You're only using fields from the Dimension table in the visual (e.g., Name, Category), without any aggregation from the Fact table.
Power BI visuals respect filter context, and if no data from the fact table corresponds to multiple selected dimension values, the visual will appear blank.
Most often, it’s due to the visual relying on the relationship direction, which doesn’t propagate filters both ways
Solution:
Option 1: Include a Field from the Fact Table in the Visual
Option 2: Check for Bi-Directional Filter (if Required)
Option 3: Use TREATAS in a Measure (Advanced)Note:
This is not a bug but expected behavior based on how relationships and filters work.
Ensure your visuals include aggregated data from the fact table, or use DAX to handle filtering intentionally.
Avoid relying solely on dimension values without any context from the fact table.
Hi mkpbi ,
The issue you're experiencing arises from how Power BI handles filter context between two related tables when multiple selections are made. In your model, you have a one-to-many relationship from the dimension table (Dim_Key) to the fact table (Fact_Key). When a single value like 148 or 150 is selected, Power BI can easily trace the relationship and return matching records from both tables. However, when multiple values are selected (like 148 and 150), Power BI sometimes cannot resolve the matching records in a visual that includes fields from both the dimension and fact tables. This leads to a blank or incomplete display, particularly for the dimension table values.
To handle this behavior and make the visual show the related dimension values correctly even with multiple selections, you can create a custom measure instead of using fields directly from both tables. For example:
Matched Fact Key =
IF (
COUNTROWS (
RELATEDTABLE('FactTable')
) > 0,
SELECTEDVALUE('FactTable'[Fact_Key]),
BLANK()
)
This measure checks whether there is a related fact record for each dimension value and only returns the Fact_Key if the relationship exists. You can then place Dim_Key from the dimension table and this new measure in your visual. This approach avoids ambiguity and ensures that multiple selections behave consistently.
Best regards,
Hi DataNinja777 ,
Thank you for the siggestion. I tried the measure as suggested but the behavior is the same. It still shows no values when I selected more than one value from the dimension table.