Reputation: 145
I want to calculate all distinct customers in a specific region. But the problem here is that my table "Customer" does not have a direct relationship with territory table, instead it has an indirect relationship.
ER Diagram of my data model is :
Upvotes: 0
Views: 1324
Reputation: 16908
You can use a measure with RELATED function as below. For direction in table relation, I have used table Sales and Region which will also give you correct answer-
customer_for_region_2 =
CALCULATE(
DISTINCTCOUNT(Sales[cus-id]),
FILTER(
Sales,
RELATED(Region[regionid]) = 2 //Hard coded region id
)
)
Upvotes: 1