You can do this a couple ways in Tableau. You can use PREVIOUS_VALUE () OR LOOKUP(), which can access values within a field a certain number of rows offset from the current, or you can utilize an INDEX() function.
All of these options will create table calculations, so you will have to include the partitioning and ordering fields in the views you create with them.
Attached is a solution using the INDEX() function to specify each time an Opportunity ID encounters a "new" Stage (including the first time, which is always new, right?) You could set up logic to make the result 0 if you don't want to always count the first instance an Opportunity ID has...
Hope this helps.
Thank you for your help with this.
I adjusted the stage change (calc) to reset every opportunity.
I would like to ask if it is possible to get this calc to do a running sum. Ultimately what I am trying to achieve is a waterfall chart where I can count the number of opportunities that moved in and out of each stage over an adjustable date range.
I have attached your document that I have altered as well as my attempt at a waterfall
Thank you for your help.