Define which series has the last point

I have that graph and I want to get the following single data:

If last point is from failed-builds then value should be 0 if it is from success-builds value should be 1

Thanks!