Isn't this what you want?

Used a gallery, you could just initiate with as many records as you like.
Items property of the Gallery in my case is [{IntValue:0},{IntValue:0},{IntValue:0}]
Gallery has two controls TextInput1 and ToggleButton
The formula in the Total label is:
"Total: " & Sum(
Filter(
Gallery1.AllItems,
ToggleButton.Value = true
).TextInput1,
TextInput1.Text
)