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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.