Forum Discussion
Anonymous
3 years agoNot applicable
Distinct count based off two columns
Hello
I am trying to create a measure that will distinct count based on more than one column. I want to count if 1). InProgram is = 1 AND 2) the program ID is distinct. I have included and example below.
- Anonymous3 years ago
Hello please try :
Count of students = CALCULATE(DISTINCTCOUNT(lmyers31[Student ID]),FILTER(lmyers31,lmyers31[InProgram] = 1))And result:
if this helps, kindly accept as solution and a kudos is appreciated
3 Replies
- AnonymousNot applicable
Hello please try :
Count of students = CALCULATE(DISTINCTCOUNT(lmyers31[Student ID]),FILTER(lmyers31,lmyers31[InProgram] = 1))And result:
if this helps, kindly accept as solution and a kudos is appreciated
- tamerj1Community Champion
Hi Anonymous
please try the following measure
Active Students = COUNTROWS ( CALCULATETABLE ( VALUES ( 'Table'[Student ID] ), 'Table'[InProgram] = 1 ) ) - AnonymousNot applicable
This worked perfectly. Thank you so much!