A final note on data modeling
To close this chapter, we should insist on something that, if followed, will save you tons of hours spent guessing where a possible mistake might be. That is, always confirm, test, and validate that the changes you make to the data model result in what you expect.
It happens many times that we add a little table here and there, modify a field name, join two tables, or something similar and that "small" change modifies our data model a little, but the final calculations are affected greatly without us even noticing.
Always make sure the modification moves you forward instead of backward.