Difference between aggregated values in a pivot visualization

I have a table with credit and debit amounts in rows. I have successfully created a summarization for each quarter to know the total credit amount and debit amount.

How can I get a difference of these two summarized amounts in the pivot formatting?

Data looks like this after summarization:
image

My end result should look like this:

Hi @rahul168
I don't know your exact dataset, but something like this might work:
C: SumIf([Price], [Category] = "Widget")
D: SumIf([Price], [Category] = "Gizmo")
Diff: SumIf([Price], [Category] = "Widget") - SumIf([Price], [Category] = "Gizmo")

Otherwise you might need to do it in SQL.

Excellent @flamber! This is very helpful. I am able to achieve what I needed.