cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Calculate Parent total based on Child values

Hi Experts,

 

I'm trying to build a flow that will calculate sales price for parent item based component prices e.g. Lamp price (150) made of a bulb (50) and the stand (100).

 

I've done a fair amount of play to get the data out of entities (data source - D365 Fin & Ops). For this I created arrays, filter actions and summarised the outcome by the following CSV tables:

 

Table 1 - Parent items

 

ItemIdParent
PARENT_01
PARENT_02

 

Table 2 - BOMs for Parent items

 

ItemIdParentBOMId
PARENT_01BOM_01
PARENT_02BOM_02

 

Table 3 - BOM Lines for Parent items

 

BOMIdItemIdComponent
BOM_01PARENT_01_COMP_A
BOM_01PARENT_01_COMP_B
BOM_02PARENT_02_COMP_A
BOM_02PARENT_02_COMP_B

 

Table 4 - Price for BOM Lines for Parent items

 

ItemIdComponentSales Price
PARENT_01_COMP_A100
PARENT_01_COMP_B50
PARENT_02_COMP_A250
PARENT_02_COMP_B150

 

Now.. based on the example above, I'd need the power automate to calculate following:

 

Table 5 - Calculated parent price

 

ItemIdParentCalculatedPrice
PARENT_01150
PARENT_02400

 

I'd appreciate any suggestions how to get the price calculated for parents (table 5). I can then later use that data to create records in Dataverse.

1 REPLY 1

I tried to use the Union expression (in Compose data operation):

union(variables('Table4'),variables('Table3'),variables('Table2'))

 

I've then extracted relevant data into CSV table which looks like this:

ItemIdParentBOMIdItemIdComponentSalesPriceComponent
 BOM_01PARENT_01_COMP_A 
 BOM_02PARENT_02_COMP_A 
 BOM_02PARENT_02_COMP_B 
  PARENT_01_COMP_A350
  PARENT_02_COMP_A200
  PARENT_02_COMP_B100
PARENT_01BOM_01  
PARENT_02BOM_02  


I assume if I get the data to the format as in the example below, it will be easier to roll up parent price. I'd appreciate recommendation how to achieve that.

 

ItemIdParentBOMIdItemIdComponentSalesPriceComponent
PARENT_01BOM_01PARENT_01_COMP_A350
PARENT_02BOM_02PARENT_02_COMP_A200
PARENT_02BOM_02PARENT_02_COMP_B100

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,632)