0
votes

I have two tables: one for email sends (Sends Table) and another for distinct individuals (User Table) as shown in the below image.

Desired Output

I would ideally like to use a calculated column in the Sends Table to indicate if an email was sent during the user's unique time-frame which is indicated in the user table (currently two time-frames max but will likely expand this to be more in the future).

I would like this indicator to be inclusive of the time-frame end date but not of the start date.

Essentially the logic would be like the following in the Sends Table, but the Timeframe dates don't populate in the expression bar:

if(
    or(
        and('Sends'[Send Date] > 'User'[Timeframe A Start], 'Sends'[Send Date] <= 'User'[Timeframe A End]),
        and('Sends'[Send Date] > 'User'[Timeframe B Start], 'Sends'[Send Date] <= 'User'[Timeframe B End])
    ),
"Yes","No")

Any help would be greatly appreciated. Thanks

1

1 Answers

0
votes

Fortunately I missed a very obvious answer by using the "related()" function:

if(
    or(
        and('Sends'[Send Date] > related('User'[Timeframe A Start]), 'Sends'[Send Date] <= related('User'[Timeframe A End])),
        and('Sends'[Send Date] > related('User'[Timeframe B Start]), 'Sends'[Send Date] <= related('User'[Timeframe B End]))
    ),
"Yes","No")