Is Substracting two SumIfs in Custom Expressions possible?

Hi,

Still new to Metabase.

My dataset looks as follows
timestamp, type, amount, project

I need to generate sum of amount when type = "payment" and type ="receipts" for all projects and then substract those sum of payments from sum of receipts and display it on the dashboard.

I was trying to accomplish is using custom expression
SumIf([Sum Amount], [Type] = "Receipt") - SumIf([Sum Amount], [Type] = "Payment")

but I am getting an error - Expected :aggregation-options, constant, or expression.

My data is in Druid.

How can I accomplish the above?

Hi @manz
You are seeing this issue:
https://github.com/metabase/metabase/issues/12327 - upvote by clicking :+1: on the first post
I'm not sure if there are any workarounds, since Druid has limited nested query options in Metabase.