[loop help] sum numbers till meet target

I want to sum the numbers till it meet a target like 500. => iteration 1

then start a new round of calculation till hit target again and till the loop end.

I tired a stupid way using moving aggregation with “window 2” .Then filter out the result that is off sum up target and aggregate with “window 3” … … …

Should I use the Variable Condition Loop in this case? I tried but failed… 🥲

Please help me 🌹 🌻