Forum Discussion

misharaina's avatar
misharaina
Advocate I
4 years ago
Solved

Using the parameter value in a measure

Using the parameter value in the measure doesn't work. Is this the standard behaviour?   Vol/mix new = IF( SELECTEDVALUE('Parameter'[Parameter1]) = "Customer" && HASONEVALUE('CustomerTable'[Cust...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi,

     

    No just declare it as a variable before the calculation

    Vol/mix new =
    var valparameter=SELECTEDVALUE('Parameter'[Parameter1])
    var result =if(HASONEVALUE('CustomerTable'[Customer]),
           [Vol/Mix Impact],
             SumXADDCOLUMNS(SUMMARIZE('Segment (Control)','Segment (Control)'[Segment]), "Vol/Mix New2"Calculate([Vol/Mix       Impact])), [Vol/Mix New2])))
     
    return
    result