Taking a shot in the dark here as I'm not sure I fully understand what you are trying to do.
I'm wondering if there is a unique identifier in each of your tables, perhaps:
1) order table has order ID
2) contract table has contract ID
3) pricing agreement matrix has a PA ID
If so, you could create a calculated field that assigns a value based on if that unique ID is null or not.
For example, if contract ID is null and PA ID is null but order ID is not null then 'Non Contract' else 'Contract'. This will add another column to your data with these values populated for each row, then you can do other aggregations based on if it is 'Contract' or not.
That might work... It would simplify it a bit, though by stating if contract ID is null and PA ID is null then Non-contract. The reason being that every record will have an order ID no matter what
I'm still struggling a bit with the Tableau calculation syntax...
IF NOT ISNULL([Contract ID]) AND NOT ISNULL([PA ID]) THEN 'No Contract' ELSE 'Contract' END
I had to switch the "No Contract" and "Contact" since the logic was reversed, but it did the trick. Thanks!