Calculated columns aren't available in the same
SELECT
statement where they're defined. You either need to repeat the calculation:
CASE
WHEN t1.org = 'x' And xDate < joiningDate THEN 1
WHEN t1.org != 'x' And yDate < joiningDate THEN 1
ELSE 0
END As PDate
Or you can use
CROSS APPLY
to define your calculated column:
SELECT
col1,
D.newDate,
CASE WHEN D.newDate < joiningDate THEN 1 ELSE 0 END As PDate
FROM
table1 As t1
LEFT JOIN table2 As t2 ON t1.id = t2.id
CROSS APPLY (SELECT CASE WHEN t1.org = 'x' THEN xDate ELSE yDate END As newDate) As D
;
The many uses of CROSS APPLY | SQL Studies[
^]