Forum Discussion
rrwprioste
8 years agoFrequent Visitor
Aggregation of Distinct Count Measure
Hello, I need to count how many teams have only one city associated with at least one employee. My data set has many columns, but the relevants for this case are the following: Team C...
- 8 years ago
Hi rrwprioste
Try these measures
# of Cities = IF(MAX([Employee])>0,CALCULATE(DISTINCTCOUNT(Data[City]),FILTER(ALL(Data),[Employee]>0&&[Team]=SELECTEDVALUE(Data[Team])))) which Team w/ one city = IF( [# of Cities] = 1,1,0) how many teams have only one city = SUMX(ALL(Data),[which Team w/ one city])
Best Regards
Maggie
nevajah
5 years agoNew Member
v-juanli-msft Hello, I found this example today and it is similar to the problem that i need to solve. How would i need to adjust the formula in above example if i need to calculate the number of teams associated with Berlin only. The result should be 1. I do understand the logic but fail to write it into a formula. It is a distinct count of teams, but combined with a check within a team that city is "Berlin" and nothing else. Thank you for your help.