Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KARIM-K
Frequent Visitor

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

1 ACCEPTED SOLUTION
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

View solution in original post

2 REPLIES 2
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

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.