Forum Discussion

cocoloco79's avatar
cocoloco79
Icon for Helper III rankHelper III
3 years ago

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))

 
Can someone help me with this? 
 
Thank you

2 Replies

  • 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)) )

  • 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])/100
     
    Second 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