I'm working in a dataset (relations) that tracks ownership of firms. If a firm has 8 owners, the firm has 8 rows in the dataset, one for each owner. A owner can have multiple firms. I want a calculated column that for row shows how many firms the specific owner owns in that sector. It is something like; for each row, search how many times the owner or owners appears in the relationship database but only count those that has the same industry code like the mother firm. This is what i have so far:
=
CALCULATE (
COUNTROWS ( Relations );
FILTER (
Relations;
Relations[participantnumber] = EARLIER ( Relations[participantnumber] )
);
FILTER ( Relations; Relations[127_industry] = Relations[127_industry] )
)
But this just gives me the total amount of firms an owner is mentioned in regardless of industry code. Thanks!