Forum Discussion

sharepointguy21's avatar
sharepointguy21
New Member
4 years ago
Solved

Measure to count values in relational tables

I have 3 tables below

Table 1

IDEmail
1[email protected]
2[email protected]
3[email protected]
4[email protected]
5[email protected]

 

Table 2

IDEmail
1[email protected]
2[email protected]

 

Table 3

IDEmail
1[email protected]
2[email protected]

 

Tables 2 and 3 have a relationship with Table 1 on email. I want to create a measure to get the count of emails from Table 1 which have matching emails in Table 2 and Table 3. In the above scenario, the measure should return 3.

  • Hi,

     

    MailCount =
       CALCULATE(
          COUNT('Table 1'[Email]),
          'Table 1'[Email] IN VALUES('Table 2'[Email]) ||
          'Table 1'[Email] IN VALUES('Table 3'[Email])
       )

1 Reply

  • lukiz84's avatar
    lukiz84
    Icon for Memorable Member rankMemorable Member

    Hi,

     

    MailCount =
       CALCULATE(
          COUNT('Table 1'[Email]),
          'Table 1'[Email] IN VALUES('Table 2'[Email]) ||
          'Table 1'[Email] IN VALUES('Table 3'[Email])
       )