Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not 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.

 

lmyers31_0-1666984862025.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello please try :

 

Count of students = CALCULATE(DISTINCTCOUNT(lmyers31[Student ID]),FILTER(lmyers31,lmyers31[InProgram] = 1))

 

 

Screenshot 2022-10-28 231437.png

 

And result:

Screenshot 2022-10-28 231431.png

 

if this helps, kindly accept as solution and a kudos is appreciated

  

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

This worked perfectly. Thank you so much!

tamerj1
Super User
Super User

Hi @Anonymous 

please try the following measure 

Active Students =
COUNTROWS (
    CALCULATETABLE ( VALUES ( 'Table'[Student ID] ), 'Table'[InProgram] = 1 )
)

 

Anonymous
Not applicable

Hello please try :

 

Count of students = CALCULATE(DISTINCTCOUNT(lmyers31[Student ID]),FILTER(lmyers31,lmyers31[InProgram] = 1))

 

 

Screenshot 2022-10-28 231437.png

 

And result:

Screenshot 2022-10-28 231431.png

 

if this helps, kindly accept as solution and a kudos is appreciated

  

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.