Available or balance on card

Hello Team, I need a help. Building an app with clients card with limit to use monthly.
The following are the card informations:
(Client A)
Limit allocation:50 liters.

Period: monthly ( there will be 50 liters on the card every month)

Limit Status: Rollover Meaning after the month, any balance or liters left on the card will be added to the next month’s 50 liters. Available=last month left + 50 liters this month

1-What formula can I use to get this available since this will repeat itself every month?

2-what if Limit status: Renew? Meaning if you use or not previous month’s balance won’t be added to the new month’s 50liters

Thanks a lot

Do you have a child table that is holding all transactions on the card? I think that’ll be key here.

You could have a monthly report that adds 50 liters to the current balance.

Or you can have a “start” date for each card record. Then in your current balance calculation, sum up all balance transactions, and add 50 per month since the start.

Yes I have a child table call transactions

How to come up with a formula for every month addition