I'm wondering if there's a simpler alternative to combining two CALCULATE statements.
In our Accounts Payable file there are two ways of getting the paid amount. (Hey, I didn't design the thing.) Under most circumstances we can do SUMX(Vouchers, [Unit Price] * [Quantity]). However, certain categories such as refunds don't have a unit price or quantity and they're entered into a different [Amount] field.
I can do two separate measures along the CALCULATE(SUMX(Vouchers, [Unit Price] * [Quantity]), FILTER(Vouchers, [Quantity >0)) and [Quantity]=0, (there are other filters, just doing this for simplicity) but I wondered if there's a way to put the IF statement inside the first parameter so I can tell which method I want to use to get the proper amount and leave the other conditions for the FILTER clause.
In our Accounts Payable file there are two ways of getting the paid amount. (Hey, I didn't design the thing.) Under most circumstances we can do SUMX(Vouchers, [Unit Price] * [Quantity]). However, certain categories such as refunds don't have a unit price or quantity and they're entered into a different [Amount] field.
I can do two separate measures along the CALCULATE(SUMX(Vouchers, [Unit Price] * [Quantity]), FILTER(Vouchers, [Quantity >0)) and [Quantity]=0, (there are other filters, just doing this for simplicity) but I wondered if there's a way to put the IF statement inside the first parameter so I can tell which method I want to use to get the proper amount and leave the other conditions for the FILTER clause.