If I understand correctly you are creating a calculation using if statement that results in a number then you want to take that number and subtract it from another measure that is a number.
see the example - I used a case statement - could be if statement
then did a simple division for example to take the total sales and divide by the scalar value (used avg as the aggregate - could have used min or max)
it will return this
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
Glad to help out
if this assisted in resolving the issue please mark my response correct to close the thread