Unfortunately, you can't use Set Analysis this way, for a few reasons. The main problem is that the Set Analysis condition is being validated once for the whole chart, not for each row.
If your data is small enough, you can get by with the calculated dimension the way you created it. It will be slower than it shoudl be...
The best way of solving this problem is creating a flag in the load script:
IF (Begin + New <> End, 1, null()) as AgencyFlag
Then your expression could simply look like this:
I'd also recommend implementing it in the Expression and not in the Calculated Dimension, because calculated dimensions are much heavier than expressions, in terms of performance.