to understand why the expression returns NULL when there are two Allocated Resource values possible.
(Try an aggregation function like sum([Allocated Resource]) )
You might also want to review your data model, I think proper linking your tables should remove your need for the if() statement, as far as I've understood your current model).