Forum Discussion
DIROPS
7 years agoFrequent Visitor
Calculate Yield
I need some assistance, I am trying to calculate the yield of a product (PLU) as it moves through work in progress steps. The table I am working with lists all the PLU's in on column, the net weight...
- Anonymous7 years ago
It would help to see the calculations as you have them and the visual you're trying to produce.
That said, here is how I did it - 2 slicer visuals, and 1 card visual:
Anonymous
7 years agoNot applicable
Hi DIROPS ,
To do this, you would need to specify both PLUs. Assuming you would always be comparing 2 only, you could do the following:
1. Create a calculated table with 2 columns, like this:
PLUs = CROSSJOIN(
SELECTCOLUMNS(DISTINCT(PLU_Table[PLU_Column]),"PLU Numerator",[PLU_Column]),
SELECTCOLUMNS(DISTINCT(PLU_Table[PLU_Column]),"PLU Denominator",[PLU_Column])
)
2. Create a calculation:
PLU % Yield =
var num = IF(
HASONEVALUE(PLUs[PLU Numerator]),
CALCULATE(
[Weight Calculation], //SUM(Weight)
FILTER(Store, Store[Store Country] = VALUES(PLUs[PLU Numerator]))
)
,0
)
var den = IF(
HASONEVALUE(PLUs[PLU Denominator]),
CALCULATE(
[Weight Calculation], //SUM(Weight)
FILTER(Store, Store[Store Country] = VALUES(PLUs[PLU Denominator]))
)
,0
)
return DIVIDE(num, den)
For the dates, that should work just by filtering.
Hope this helps,
Nathan
- DIROPS7 years agoFrequent Visitor
Got the first part working, by creat a calculation do you mean create a calculated coulumn in my new table or a measure?
- Anonymous7 years agoNot applicable
DIROPS - 2nd part is a measure.
- Anonymous7 years agoNot applicable
Also, the [Weight Calculation] should be a separate Measure, called something like [Total Weight].