Method 1:
Handling it the way the report is designed currently.
You would need to explicitly give the value in source expression of Lookup.
=Lookup("A", Fields!A.Value, Fields!Total.Value, "Dataset 2")
/Lookup("B", Fields!A.Value, Fields!Total.Value, "Dataset 2")
Method 2:
I would probably redesign the datasets and combine the dataset 1 and dataset 2. It will help remove doing funky logic in the report. Use new dataset to populate the matrix.
New Dataset:
SELECT CAST(Year as varchar(10)), A, Total
FROM DataSet1_Table
UNION ALL
SELECT 'L12M', A, Total
FROM DataSet2_Table