This is a little bit hard without a sample of the data, but I'm wondering if something like this would work for you.
In the attached workbook I used Ship Date as B and Order Date as A
The test column is returning a 1 when B is >A
The total at the top tells you how many there were in all.
I don't think this is exactly what you were going for, but I thought it might help get you closer based on the info I had.
Im sorry but I am not available to view other tableau workbooks at the time being.
But a thought if you're using a date that seems easier. I need to compare to string values. For example cats and dogs. But somehow I need to code cats = 2, dogs = 1. Now I need a count of how many are greater than.
You'll want to write a calculated field that assigns those strings to an integer value.
IF [field]="cats" THEN 2
ELSEIF [field]="dogs" then 1