Forum Discussion
Power BI
- 1 year ago
Hi Shahnaz_Fathima ,
Your issue is happening because of the Many-to-Many (M:M) relationship between Append1 and BridgeTable. In such cases, filtering behavior doesn't always work as expected.
Why is the project selection not affecting the count?
You have a Many-to-Many (M:M) relationship between Append1 and BridgeTable, which can sometimes cause unexpected aggregations.Your relationship structure is:
Append1 (Many) → BridgeTable (Many)
BridgeTable (Many) → Teamsize (One)
When you select a Client, it works fine because Teamsize aggregates at the client level.
But when you select a Project, the Many-to-Many relationship does not pass filters correctly to Teamsize, causing it to always return the Client-Level total.
Try below:
Option 1: Use TREATAS in a Measure
Instead of relying only on relationships, try using TREATAS in a measure to enforce filtering at the project level.DAX
TeamSizeMeasure = VAR SelectedProjects = VALUES(Append1[ProjectID]) RETURN CALCULATE( SUM(Teamsize[TeamSizeCount]), TREATAS(SelectedProjects, Teamsize[ProjectID]) )Option 2: Change Relationship Type
Try Many-to-One between Append1 → BridgeTable if possible.If you need a Many-to-Many relationship, ensure bidirectional filtering is enabled (instead of single-directional).
Steps to enable bidirectional filtering:
Go to Model View in Power BI.
Select the relationship between Append1 and BridgeTable.
Change the filter direction to Both.
Test if selecting a project updates the count dynamically
If the above methods don’t work, create a helper table that maps Projects to Clients, ensuring a more structured Many-to-One relationship.
Please mark this post as solution if it hepls you. Appreciate Kudos.
Hi Shahnaz_Fathima ,
Your issue is happening because of the Many-to-Many (M:M) relationship between Append1 and BridgeTable. In such cases, filtering behavior doesn't always work as expected.
Why is the project selection not affecting the count?
You have a Many-to-Many (M:M) relationship between Append1 and BridgeTable, which can sometimes cause unexpected aggregations.
Your relationship structure is:
Append1 (Many) → BridgeTable (Many)
BridgeTable (Many) → Teamsize (One)
When you select a Client, it works fine because Teamsize aggregates at the client level.
But when you select a Project, the Many-to-Many relationship does not pass filters correctly to Teamsize, causing it to always return the Client-Level total.
Try below:
Option 1: Use TREATAS in a Measure
Instead of relying only on relationships, try using TREATAS in a measure to enforce filtering at the project level.
DAX
TeamSizeMeasure =
VAR SelectedProjects = VALUES(Append1[ProjectID])
RETURN
CALCULATE(
SUM(Teamsize[TeamSizeCount]),
TREATAS(SelectedProjects, Teamsize[ProjectID])
)
Option 2: Change Relationship Type
Try Many-to-One between Append1 → BridgeTable if possible.
If you need a Many-to-Many relationship, ensure bidirectional filtering is enabled (instead of single-directional).
Steps to enable bidirectional filtering:
Go to Model View in Power BI.
Select the relationship between Append1 and BridgeTable.
Change the filter direction to Both.
Test if selecting a project updates the count dynamically
If the above methods don’t work, create a helper table that maps Projects to Clients, ensuring a more structured Many-to-One relationship.
Please mark this post as solution if it hepls you. Appreciate Kudos.