Forum Discussion
dax in drilldown works without relationship
- 1 year ago
Hi animebuff ,Thank you for reaching out to Microsoft Fabric Community Forum.
If the direct relationship between the dimCountry table and the fact table is removed, it will impact the filtering context, so now you see the same total for all regions.We can use the TREATAS function to create a virtual relationship between the dimCountry table and the fact table. This way, we can eliminate the physical relationship while keeping the correct context for the calculations.
Sample Data:dimCountry Table
fact Table
Total Value Measure:
Total Value =
VAR SelectedCountries = VALUES(dimCountry[Country])
RETURN
CALCULATE (
SUM(fact[Value]),
TREATAS(SelectedCountries, fact[Country])
)
Set up a Matrix Visual:Sample Output:
If this helps, please mark it ‘Accept as Solution’, so others with similar queries may find it more easily. If not, please share the details.
- 1 year ago
Hi animebuff , Just checking in—were you able to resolve the issue?
If one of the replies helped, please consider marking it as "Accept as Solution" and giving a 'Kudos'. Doing so can assist other community members in finding answers more quickly.
Thank you!
Hi animebuff , Just checking in—were you able to resolve the issue?
If one of the replies helped, please consider marking it as "Accept as Solution" and giving a 'Kudos'. Doing so can assist other community members in finding answers more quickly.
Thank you!
sure will do it