Forum Discussion
rajibmahmud
8 years agoHelper III
Cost calculation from Bottomup
Hi Team, I am trying to calculate a cost using bottom up method at monthly level. Where cost would be Vol sold in Month 1, multiplied by Cost in month 1 at Product Level. The total year cost ...
Floriankx
8 years agoSolution Sage
Hello is the combination of Month, Year and SKU unique in each table?
If it would be you could use the following:
Measure:=SUMX(fCost; VAR Actual_Year=fCost[Year] VAR Actual_Month=fCost[Month] VAR Actual_SKU=fCost[SKU] RETURN fCost[Cost]*CALCULATE(SUM(fValue[Value]);FILTER(fValue;fValue[Year]=Actual_Year&&fValue[Month]=Actual_Month&&fValue[SKU]=Actual_SKU)))
Assumptions made:
Table with Cost is named fCost
Table with Volume is named fValue. Volume is here called Value.
Measure is created in fCost table.
The combination of Year, Month and SKU is unique in each row of fCost.
Now combination (Year, Month, SKU) appears in fValue which is not in fCost.
Tables are not related.
If you create a Pivot with Year, Month and SKU from fCost it should be fine.
rajibmahmud
8 years agoHelper III
Thanks a lot. I will put it in my model and try.
But it seems in Filter I have to put Year hard coded rather than it being dynamic. Am I right?
- Floriankx8 years agoSolution Sage
Hello,
no it is not hard coded. With VAR you define your actuals dynamically.