I have a “transaction” table with status, balance and price. I need the dax for for an “if this condition, calculate this, otherwise, calculate this” for each status in the table (an example pbix file is attached)

Conditions are: If the balance is 0 then the total of Status is based on "price’, if the balance is greater than 0 (or my “otherwise”), then the total is based on “balance”

I tried using “switch” but I’m just doing my Dax wrong and can’t figure out the correct way to write it.

StatusA when Bal 0 = CALCULATE( SUM(Transaction[price]), Transaction[status] = “status A”, SWITCH(IF(Transaction[balance]=“0”, sum(Transaction[balance]))))

Any help is appreciated.

Trans DAX help.pbix (39.5 KB)