Power BI – How To Make Calculated Columns in a Related Table for Rows that Don’t Exist in the Other Table

Scenario: Table A contained values that did not exist in Table B. Nevertheless, I wanted to use a Boolean calculation on those values. I was frustrated for several hours until I realised that what I really needed to do was create the column in Table A, and use the RELATED keyword.

Original Query (Table B on the right side):

GoodVersion = SWITCH(TRUE(), ISBLANK(Query2[First Seen]), FALSE(), DATEDIFF(Query2[First Seen],UTCTODAY(),DAY) <= 90, TRUE(), FALSE(), FALSE())

Result:

Fixed Query (Table A on the left side):

GoodVersion = SWITCH(TRUE(), ISBLANK(RELATED(Query2[First Seen])), FALSE(), DATEDIFF(RELATED(Query2[First Seen]),UTCTODAY(),DAY) <= 90, TRUE(), FALSE(), FALSE())

Result: