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
OleMcDonald
Helper I
Helper I

Count records in a joined table

I have two tables [Account] and [Contact]

They have a one (account) to many (contact) join 

The [Contact] table has a [Job Group] column

The [Job Group] is populated with a single value like "CEO" or "CFO" of "CIO"

 

I am trying to figure out how many [Account] records do not have a "CEO"

 

I tried using the Quick Measure to come up this this but it gives me a total count of accounts, not just accounts without  a CEO

Count of Id for CEO = 
CALCULATE(
	COUNTA('Account'[Id]),
	'Contact'[Job_Group__c] <> { "CEO" }

 

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @OleMcDonald 

 

Count of Id for CEO =
COUNTROWS (
    FILTER (
        'Account',
        CALCULATE ( COUNT ( 'Contact'[Job_Group__c] ), 'Contact'[Job_Group__c] = "CEO" ) = 0
    )
)

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

See if this measure works. You shouldn't use COUNTA() here. The only thing it can do that COUNT cannnot is use boolean comparisons, but I don't think you need that. Just count the rows that meet your critera.

Counting Measure =
COUNTROWS(
    FILTER(
        TableName,
        TableName[Field] <> "CEO"
    )
)

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
AlB
Community Champion
Community Champion

Hi @OleMcDonald 

 

Count of Id for CEO =
COUNTROWS (
    FILTER (
        'Account',
        CALCULATE ( COUNT ( 'Contact'[Job_Group__c] ), 'Contact'[Job_Group__c] = "CEO" ) = 0
    )
)

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

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
Top Kudoed Authors