Forum Discussion
calcualted column Parameter retuning 0
Hi everyone.
I have trouble with this calculated column:
(Corn) Est. 30 Cob Units = ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30) + ('(Piece) Parameter'[(Piece) Parameter Value]* ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30))
When applied the calculation only return a value for the first part of the formula which is ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30)
The second part of the formula returns 0.
('(Piece) Parameter'[(Piece) Parameter Value]* ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30))
2 Replies
- amitchandak
Super User
cocoloco79 , if (Piece) Parameter'[(Piece) Parameter Value] is parameter (what if/numeric) and you are expecting the slicer value, then it will not work.
A calculated column can not take slicer value. You need to create a meausre
example
(Corn) Est. 30 Cob Units = Sumx(BI_Planting, ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30) + ('(Piece) Parameter'[(Piece) Parameter Value]* ((BI_Planting[(Corn) Est. Cobs/ Planting]*BI_Planting[(Corn) L Default]/100)/30)) )
- cocoloco79
Helper III
I was able to resolve this using two measures, I'm posting this in case someone else runs into the same issue.
First Measure
(Pieces) 30 Cob Units (NOSUM) = (DIVIDE([(Pieces) Est. Cobs/ Planting (SUMX)] * SUM('BI_Planting'[(Corn) L Default]),100)/30) + ((DIVIDE([(Pieces) Est. Cobs/ Planting (SUMX)] * SUM('BI_Planting'[(Corn) L Default]),100)/30)*'(10 Unit) Parameter'[(10 Unit) Parameter Value])/100Second and final measure.(Pieces) 30 Cob Units(SUMX) = SUMX(SUMMARIZE(BI_Planting,BI_Planting[PlantingName],BI_Planting[PlantingCode],"value",[(Pieces) 30 Cob Units (NOSUM)]),[Value])Not a neat solution, please feel free to correct what I posted.Thanks