Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

calculation help

i have two tables,

 

Table1  and  Table2  as below.

Table1 have 'User' and 'Email' columns.  Each  User will have multiple 'Email' s associated with them.

Table2 have 'Msg_ID', 'SenderEmail', 'ReceiverEmail', 'ReceivedDate' columns. 

 

I want to find  all the 'Users' from  'Table1' who neither send nor received any emails.

 

So, from below table, we can see  'Mark'  and 'Pete'  are the only users who does not have record in Table2 either in SenderEmail or ReceivedEmail.

 

 

 

Table1

UserEmail
johnjohn@abc.com
johna,john@abc.com
johnjohn@xyz.com
Markmark@abc.com
Markmark@xyz.com
Davedave@abc.com
Davea.dave@abc.com
Davedave@xyz.com
Craigcraig@abc.com
Tonytony@abc.com
Petepete@abc.com

 

Table2

Msg_IDSenderEmailReceiverEmailReceivedDate
1john@abc.commike@comp.com6/10/2019
2dave@abc.comjoe@gmail.com6/12/2019
3joe@gmail.comdave@abc.com6/20/2019
4rob@gmail.comjohn@abc.com6/23/2019
5jeff@gmail.comtony@abc.com6/25/2019
6craig@abc.comalex@gmail.com6/24/2019
1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

I create a sample using measures you can reference.

Measure = var s = VALUES(Table2[SenderEmail])
var r = VALUES(Table2[ReceiverEmail])
return
IF(MAX(Table1[Email]) in s || MAX(Table1[Email]) in r, 0,1)
Measure 2 =
VAR countr =
CALCULATE ( COUNTROWS ( Table1 ), ALLEXCEPT ( Table1, Table1[User] ) )
VAR ck =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( ALLEXCEPT ( Table1, Table1[User] ), [Measure] = 1 )
)
RETURN
IF ( countr = ck, VALUES(Table1[User]), 0 )

1.jpg

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

I create a sample using measures you can reference.

Measure = var s = VALUES(Table2[SenderEmail])
var r = VALUES(Table2[ReceiverEmail])
return
IF(MAX(Table1[Email]) in s || MAX(Table1[Email]) in r, 0,1)
Measure 2 =
VAR countr =
CALCULATE ( COUNTROWS ( Table1 ), ALLEXCEPT ( Table1, Table1[User] ) )
VAR ck =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( ALLEXCEPT ( Table1, Table1[User] ), [Measure] = 1 )
)
RETURN
IF ( countr = ck, VALUES(Table1[User]), 0 )

1.jpg

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.