Storing counter hitstory

I’m looking for ideas how to store and use counter history after resetting it.

I’d like to tie a counter button to my Sodastream so I can track how many bottles I’m getting per gas canister over time, and potentially also how long a gas canister is lasting me.

I can see the history on the counter, but not sure how I’d use that data to make those calculations.