Deals table : ID, DealName, and so on
Deposits table: ID, Deal_ID (ref to deals table), DepositDate,DepositAmount
This structure means that every row in deposits table will represent a deposit rather than all the deposits for a deal.
By having the column Deal_ID ref to Deals table, that means that that deposit is assigned to a specific deal.
COUNTING THE NUMBER OF DEPOSITS
In the Deals table, you can add a virtual column (your Number of Deposits - but virtual column) with the formula
this means: go to Deposits table and count all the deposits that have the column Deal_ID equal with the ID column of this deal.
Then you go to Deposits Inline view and sort descending by [DateColumn] (I am assuming you have a date column)
When you will open Deals Details view in your app, you will have a small table (called nested table) with all your deposits for that deal, with the last deposit being first in the list. That’s why you did that sorting earlier.
In the settings of Deal Details view, you will see
This is set by default to 5.
This means how many rows you will see in that small table on the Deals Details view.
Under the nested table you will have 2 “buttons”, View and Add
View - opens the deposits page and will only have the deposits for that deal
Add - opens a form to add a new deposit for that deal.
I hope it is what you are looking for and it helps.