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
v-juanli-msft
8 years agoCommunity Support
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