'SSRS: How to get count of equal ID of two columns after filter

I have the following table (Dataset2):

enter image description here

ACCOUNT_ID
8d82a329-f23e-ec11-8c62-000d3a8252c3
8988e53a-1158-ec11-8f8f-002248171edf
8988e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
8b88e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
b788e53a-1158-ec11-8f8f-002248171edf
b788e53a-1158-ec11-8f8f-002248171edf
b988e53a-1158-ec11-8f8f-002248171edf

CCA_AGENT_ID
8788e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9988e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9788e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
9b88e53a-1158-ec11-8f8f-002248171edf
b788e53a-1158-ec11-8f8f-002248171edf
b788e53a-1158-ec11-8f8f-002248171edf
b988e53a-1158-ec11-8f8f-002248171edf

CJ_ID
8098037c-6d89-ec11-93b0-000d3a82c9fa
ac101b6f-478e-ec11-b400-000d3a817222
ac101b6f-478e-ec11-b400-000d3a817222
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
ac101b6f-478e-ec11-b400-000d3a817222
ac101b6f-478e-ec11-b400-000d3a817222
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
fabc5219-198e-ec11-b400-000d3a817bb3
ddb8ebf6-468e-ec11-b400-000d3a817222
ddb8ebf6-468e-ec11-b400-000d3a817222
9ed93c43-478e-ec11-b400-000d3a817222

I want to filter first by CJ_ID from the value of ID on DataSet1 (Primary dataset) then count all rows where ACCOUNT_ID = AGENT_ID

The DataSet2 contains this fields:

enter image description here

I created a Calculated field with the expression below with name AccEqualsAgent:

enter image description here

I set this expression on the textbox and gives 0 value:

enter image description here

However, I try to aggregate the value of AccEqualsAgent field and it displays 22:

enter image description here

Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source