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?

0 2 250
2 REPLIES 2

Try this:

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

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]))

Top Labels in this Space