Forum Discussion
pmetaliya
Advocate I
5 years agoCalculate distinct count total at a group level
Hi, I'm trying to create a measure to get the "Other" count for each ethnicity but having trouble calculating total distinct count group by Ethnicity. There is 1:M relationship between Person(Ethni...
- 5 years ago
# Incident = CALCULATE(DISTINCTCOUNT('Behavior'[DISCIPLINE_INCIDENT_ID])) # Incident All 1 = SUMX( VALUES('Person'[Ethnicity]), [# Incident]) # Incident Other 1 = VAR _all=CALCULATE([# Incident All 1],ALL(Person[Ethnicity])) RETURN IF([# Incident All 1],_all-[# Incident All 1])
wdx223_Daniel
Community Champion
5 years ago# Incident = CALCULATE(DISTINCTCOUNT('Behavior'[DISCIPLINE_INCIDENT_ID]))
# Incident All 1 =
SUMX(
VALUES('Person'[Ethnicity]),
[# Incident])
# Incident Other 1 = VAR _all=CALCULATE([# Incident All 1],ALL(Person[Ethnicity])) RETURN IF([# Incident All 1],_all-[# Incident All 1])
pmetaliya
Advocate I
5 years agoWow. Thanks, Daniel. Your measures are working as expected.