I almost had it, but then you gave me this last example and I don't get it anymore.
この場合、次のような言い方ができますよ。
ーI almost had it, but then you gave me this last example and I don't get it anymore.
「もう少しでわかりそうだったのに、最後の例文でわからなくなった」
I almost had it で「もう少しでわかりそうだった」と言えます。
ご参考まで!