I perform an analysis where we look at the materials that we produced in the current month and compare the usage of components to the same period last year.
The difference calculation works when a product was produced both this and last year. However, I need to exclude materials from the calculation that were only produced this year but not last year or last year but not this year.
I’ve spent a day and a half and I’m not close to an answer. It seems that if I build the logic into the iterating calculations, it applies it to the component/material level instead of the total material level.
How do I exclude the materials for the specified condition?
Do I need to modify the code or add new code elsewhere?
Component Difference = CALCULATE ( SUMX ( SUMMARIZE ( 'Unique Mat Comp Plt', 'Unique Mat Comp Plt'[Material], 'Unique Mat Comp Plt'[Component Material] ), IF ( [Component LBs CY] - [CY LBS at PY Rate] = 0, - [Component LBS PY], [Component LBs CY] - [CY LBS at PY Rate] ) ) ) ![No%20PY%20volume|689x222](upload://qgLFJ3GxMqo0DFINYCs2WqwCSuP.png)