Expression to Count Records that Match a Certain ID

Hi team,

I’m trying to create an expression to count client records according to the company ID that they belong to.
I started with this expression below, but realized this is counting all records for all companies.

COUNT(Clients[_ROWNUMBER])

I’ve tried this as an alternative
COUNT(Clients[_THISROW].[Employer] = [Company ID])

But I get the error that it can’t find the column Employer

Any ideas?

Try this:

COUNT(SELECT(Clients[KeyColumn], [_THISROW].[Employer] = [Company ID]))

2 Likes

Thanks for your help.
This worked with one adjustment, I had the Employer and Company ID switched

COUNT(SELECT(Clients[Email], [_THISROW].[Company ID] = [Employer]))

2 Likes