Hello @haneesh312 ,
Have you tried creating two new calculated items, one for As and one for Bs, and then calculate the difference?
Something along the lines:
New calculated item for As:
IF (Category = 'A' )
RETURN Measure
ELSE 0
And a similar for Bs.
Then a new measure to calculate the difference between these two. Of course you need to take care of the percentage of total also.
Best regards,
Petri