Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nirav_bhimani
Partner - Specialist
Partner - Specialist

Problem in Hierarchy calculation

HI Everyone,

I am creating one demo for recipe cost using hierarchy. While calculating the cost of root product it gave me wrong result i.e. 287.67 but according to manual calculation in excel it is 266.14 for Product A. see the sheet2. It happens because it is considering the sum of all the B components(Quantity * Unitcost)  to that total ie. 266.14 + 20.52

Is there any way I can get the total as 266.14 as my final result.

                                                                                     Hierarchy Structure:

                                                                                                   A

                                                                                               /          \

                                                                                             B            C

                                                                                         /          

                                                                                B1.......... B11

Thanks & Regards,

Nirav Bhimani

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You're summing costs of the B* parts twice since you've already included them in the unit cost of B. What you can do to present it as you want is use this expression:

if(Dimensionality()=3,SUM([Unit Cost]* Quantity),SUM({<Depth-={3}>}[Unit Cost]* Quantity))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You're summing costs of the B* parts twice since you've already included them in the unit cost of B. What you can do to present it as you want is use this expression:

if(Dimensionality()=3,SUM([Unit Cost]* Quantity),SUM({<Depth-={3}>}[Unit Cost]* Quantity))


talk is cheap, supply exceeds demand
nirav_bhimani
Partner - Specialist
Partner - Specialist
Author

Hi,

Thanks allot my friend. It works.

Thanks & Regards,

Nirav Bhimani