I think that with the data sample you showed in image 1, it will not be possible to calculate as you suggest.
You are looking to group by either departure or arrival, but then count outside the group. I don't think that is possible.
If it is possible to change the data format a bit however it is easy to do.
Attached is an excel sheet with sheet1 - your format and sheet2 - new format that is easier to calculate. I think there is an excel addon available from Tableau that might help you change the shape of your data to match.
From sheet 1, I could not find any way to make as you required.
From sheet 2 it is not too complicated - see tableau workbook also in attached zip.
Hope this helps,
Apples and Bananas.zip 17.3 KB
Thank you for that - I understand what you mean now, that example was perfect.
My data comes in a continuous live flow in the format I have specified, I don't suppose you or anyone else has any ideas on how to dynamically convert my columns into the format you specified? Weather it be with a select or even in Excel.