Forum Discussion

KARIM-K's avatar
KARIM-K
Frequent Visitor
4 years ago
Solved

Computing purchasing price fluctuation year over year

Hi Everyone,

 

I am struggling with the calculation of purchasing price fluctuation (variance) when it comes to items that where discontinued in middle of year N and replaced by a new item which basically has the same functionnality than the item discontinued and therefore to calculate the price variance of item 2 we should consider the unit price of item 1 in year N-1.

 

Item IDItem DescQuantity Year N-1Unit Price N-1Purchase Price N-1Quantity NUnit Price NPurchase Price NPrice Variance
1Item 1501,260101,3131,00
2Item 2202,346302,4723,00
3Item 3000201,35273,00
4Item 4000401,4568,00
5Item 5000251,6400,00
 Total701,511061251,6620815,00

In this example Item 1 was discontinued in Year N and replaced by Item 3 which was replaced later on by item 4. To calculate the price variance of Item 3 and 4, I need to consider that their unit price in year N-1 is the same as item 1 which is 1,2. Somehow, we needd an association between items 1 , 3 and 4

For Item 5 and since it is a new item, the price variance = 0.

I have tried to model this using Dax functions but without any success.

Any help please to figure out the approriate Dax function.

Best Regards,

Karim

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi KARIM-K ,

     

    Need an association between items 1 , 3 and 4. The data currently displayed is not enough to create an association.

     

    Best Regards,

    Jay

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi KARIM-K ,

     

    Need an association between items 1 , 3 and 4. The data currently displayed is not enough to create an association.

     

    Best Regards,

    Jay

    • KARIM-K's avatar
      KARIM-K
      Frequent Visitor

      Hi jay,

       

      Thanks for your mail. If I add a new column stating the association between the 3 items does it help to figure out the solution and write down the appropriate dax function to get the appropriate result.

      For the new Column, we can introduce a join item ID: 

      Item IDItem ID Join

      1

      1-3-4
      22
      31-3-4
      41-3-4
      55

       

      Does it make sense ?

       

      Best Regards,

      Karim