This is an excellent example of where table calculations are useful to create a higher level of aggregation. I created the following calculated field:
IF FIRST() == 0 THEN
WINDOW_SUM([calculation], 0, IIF(FIRST()==0,LAST(),0))
The IF FIRST() and IIF() statements are to reduce the number of results returned so we don't get overlapping text, this uses a technique developed by Richard Leeke here: http://www.clearlyandsimply.com/clearly_and_simply/2011/01/another-look-at-site-catchment-analysis-with-tableau-6-part-3.html
The meat of the statement is the WINDOW_SUM([calculation]…). Drag that into the view, set the Compute Using to PID (assuming both COID and PID are available in the view), and you're all set. This is done in the attached workbook.
simple window sum.twbx.zip 29.4 KB