I am assuming you wish for an expression that would plot this on a chart, with date as the dimension?
In that case, create a chart with Date (End_Time) as a dimension, set it so that it does not show nulls (this will remove the need to reference the bookmark in the expression, but you can still do it that way if you wish!)
You will then need to use the above() function and rangesum() in the expression
Above() returns values in the "rows" above the date that you are looking at (imagine as if your chart was a table)
and Rangesum() takes those values and sums it.
Rather than an if statement, the statement -(end_time - start_time < 7) will return 1 if the time taken was <7 days (168 hours)
It should look something like:
=rangesum( above ( total sum( -(end_time - start_time < 7) ),0,7))
This will sum the number of tasks completed within 168 hours.To keep things simpler, and calculations quicker, I recommend calculating a "timeTaken" column in the script or a flag to show when the tasks were completed in the target.
Let me know if this works!