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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FruitBat
Frequent Visitor

Count Row with Multiple Criteria

Having difficulty counting the number of users with multiple group assignments.  Data look like that found in the table below.  Solution I seek is "1", indicating that there's a count of only one user - John - who's assigned to multiple groups (A, B, C).  In this instance, I don't want to count Ted and Bill; they're only assigned to one group.

 

Kind thanks!

 

Name

NameGroup
JohnGroup A
JohnGroup B
JohnGroup C
TedGroup A
Bill

Group A

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@FruitBat Please create following measure to get count of name associated with more then one group

Measure = 
VAR _groupCount = CALCULATE(COUNTX('Table','Table'[Group]),ALLEXCEPT('Table','Table'[Name]))
VAR _table = SUMMARIZE('Table','Table'[Name],"GroupCount",CALCULATE(COUNTX('Table','Table'[Group]),ALLEXCEPT('Table','Table'[Name])))
RETURN SUMX(FILTER(_table,[GroupCount]>1),[GroupCount])

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, @FruitBat 

You can first create a column to check whether the names match your conditions, then create a measure to distinct count ‘True’
true matched.JPG

matched column = IF(CALCULATE(DISTINCTCOUNT('Table'[Group]), 
                      ALLEXCEPT('Table', 'Table'[Name])) > 1, TRUE(), FALSE())

count measure = CALCULATE(DISTINCTCOUNT('Table'[Column]), 'Table'[Column] = TRUE())

 

Paul
Best
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@FruitBat Please create following measure to get count of name associated with more then one group

Measure = 
VAR _groupCount = CALCULATE(COUNTX('Table','Table'[Group]),ALLEXCEPT('Table','Table'[Name]))
VAR _table = SUMMARIZE('Table','Table'[Name],"GroupCount",CALCULATE(COUNTX('Table','Table'[Group]),ALLEXCEPT('Table','Table'[Name])))
RETURN SUMX(FILTER(_table,[GroupCount]>1),[GroupCount])

Nailed it.  Thanks, @Anonymous !

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors