You will want to use the TOTAL modifier to ignore the dimension, allowing you to get the total for Paid and Denied. You want to respect the selection on CPT Code, so you need to TOTAL by that field.
Something like this:
Sum(Amount)/Sum(TOTAL <CPTCode> Amount)
That should work for both Paid and Denied. Replace the CPTCode and Amount with the field names from your dataset.