I am not sure why it is not working. Is it because -
Level 1 As Heading
Level 2 as
If (Heading='Gross Sale',Dimension A,
If (Heading='Discount',Dimension B)) !
It should be Gross Sale not Gross sale.
PFA the app where it works perfectly fine.
WebApp_309284.qvf 208.0 K