If this has been answered and fit exactly to my environment, please point me to the link. I been searching for weeks but unable to find a solution that based on dataverse for team. The scenario is building an expense report which will have approval flow etc. I know there are several videos for this including Reza Dorrani but those are not dataverse for team.
This is the parent table "TestHeader"


This is the child table "TestDetail"


All data shown are input manually for illustration purpose.
My question is how do I link whatever line items the user input into TestDetail through Power Apps to the one parent ID (HeaderKey), and the TotalCost column of TestHeader will aggregate the LineCost automatically.
All these must be done in Dataverse for Team, hence some functions wont work e.g. calculated/rollup field