I attempting to use PowerPivot to calculate our group standard cost across a number of plants globally. The trick is that often we have intercompany (inter-plant) materials whose standard cost is that of the selling plant's. The calculation of this is causing some circular references, despite me being able to do this in excel with IF statements. The data is simply far too large to process in excel.
Here is a sample of my data and what I'm trying to do. The end goal is to fill in IntercoPrice, P1 (plant1), p2, and p3
[TABLE="class: grid, width: 1000"]
<tbody>[TR]
[TD]Plant-Mat[/TD]
[TD]Plant [/TD]
[TD]Material [/TD]
[TD]Vendor [/TD]
[TD]StdCost [/TD]
[TD]Intercompany [/TD]
[TD]IntercoPrice [/TD]
[TD]P1[/TD]
[TD]P2[/TD]
[TD]P3[/TD]
[TD]P4[/TD]
[/TR]
[TR]
[TD]P1-m123[/TD]
[TD]P1[/TD]
[TD]m123[/TD]
[TD]P2[/TD]
[TD]1.00[/TD]
[TD]Yes[/TD]
[TD]1.75[/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P2-m123[/TD]
[TD]P2[/TD]
[TD]m123[/TD]
[TD]P4[/TD]
[TD]1.25[/TD]
[TD]Yes[/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P3-m123[/TD]
[TD]P3[/TD]
[TD]m123[/TD]
[TD]Vendor[/TD]
[TD]1.50[/TD]
[TD]No[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD]1.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P4-m123[/TD]
[TD]P4[/TD]
[TD]m123[/TD]
[TD]Vendor[/TD]
[TD]1.75[/TD]
[TD]No[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1.75[/TD]
[/TR]
</tbody>[/TABLE]
GIVEN: Plant, Material, Vendor, StdCost
CALCULATED: Plant-Mat (primary key, concatenation to create unique identifier)
Intercompany (looks for plant names in the "Vendor" column)
IntercoPrice (uses a series of if statements to determine the vending plant and refers to the relative column)
=IF([Intercompany]="Yes", LOOKUPVALUE(IF([Vendor]="P1",[P1], IF([Vendor]="P2",[P2], IF([Vendor]="P3",[P3]))), [Plant-Mat], [Vendor]&"-"&[Material],0)
LOOKUPS: P1, P2, P3, P4
This uses a lookup on the concatenation of Vendor&"-"&Material to run against the Plant-Mat column and return the IntercoPrice
=IF([Intercompany]="Yes", LOOKUPVALUE([IntercoPrice], [Plant-Mat], [Vendor]&"-"&[Material]), [StdCost])
Issues:
1) The above creates a circular reference.
2) While I have included all these plants looking up an IntercoPrice when intercompany = yes, in reality I have several plants that do not follow this rule, hence the Interco price step. I need to be able to turn off and on the ability to lookup intercompany pricing. Removing this step would complicate things later on for me.
3) In the actual sheet there is 22 fields of given data, 23 plants, and 197,000 rows of data. I run through 2-10 conditions for each plant. The process for calculating intercompany pricing is the only one currently giving me a headache.
Here is a sample of my data and what I'm trying to do. The end goal is to fill in IntercoPrice, P1 (plant1), p2, and p3
[TABLE="class: grid, width: 1000"]
<tbody>[TR]
[TD]Plant-Mat[/TD]
[TD]Plant [/TD]
[TD]Material [/TD]
[TD]Vendor [/TD]
[TD]StdCost [/TD]
[TD]Intercompany [/TD]
[TD]IntercoPrice [/TD]
[TD]P1[/TD]
[TD]P2[/TD]
[TD]P3[/TD]
[TD]P4[/TD]
[/TR]
[TR]
[TD]P1-m123[/TD]
[TD]P1[/TD]
[TD]m123[/TD]
[TD]P2[/TD]
[TD]1.00[/TD]
[TD]Yes[/TD]
[TD]1.75[/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P2-m123[/TD]
[TD]P2[/TD]
[TD]m123[/TD]
[TD]P4[/TD]
[TD]1.25[/TD]
[TD]Yes[/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD]1.75[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P3-m123[/TD]
[TD]P3[/TD]
[TD]m123[/TD]
[TD]Vendor[/TD]
[TD]1.50[/TD]
[TD]No[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD]1.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]P4-m123[/TD]
[TD]P4[/TD]
[TD]m123[/TD]
[TD]Vendor[/TD]
[TD]1.75[/TD]
[TD]No[/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1.75[/TD]
[/TR]
</tbody>[/TABLE]
GIVEN: Plant, Material, Vendor, StdCost
CALCULATED: Plant-Mat (primary key, concatenation to create unique identifier)
Intercompany (looks for plant names in the "Vendor" column)
IntercoPrice (uses a series of if statements to determine the vending plant and refers to the relative column)
=IF([Intercompany]="Yes", LOOKUPVALUE(IF([Vendor]="P1",[P1], IF([Vendor]="P2",[P2], IF([Vendor]="P3",[P3]))), [Plant-Mat], [Vendor]&"-"&[Material],0)
LOOKUPS: P1, P2, P3, P4
This uses a lookup on the concatenation of Vendor&"-"&Material to run against the Plant-Mat column and return the IntercoPrice
=IF([Intercompany]="Yes", LOOKUPVALUE([IntercoPrice], [Plant-Mat], [Vendor]&"-"&[Material]), [StdCost])
Issues:
1) The above creates a circular reference.
2) While I have included all these plants looking up an IntercoPrice when intercompany = yes, in reality I have several plants that do not follow this rule, hence the Interco price step. I need to be able to turn off and on the ability to lookup intercompany pricing. Removing this step would complicate things later on for me.
3) In the actual sheet there is 22 fields of given data, 23 plants, and 197,000 rows of data. I run through 2-10 conditions for each plant. The process for calculating intercompany pricing is the only one currently giving me a headache.