Forum Discussion
misharaina
4 years agoAdvocate I
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...
- Anonymous4 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],
SumX( ADDCOLUMNS(SUMMARIZE('Segment (Control)','Segment (Control)'[Segment]), "Vol/Mix New2", Calculate([Vol/Mix Impact])), [Vol/Mix New2])))returnresult
Anonymous
4 years agoNot applicable
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],
SumX( ADDCOLUMNS(SUMMARIZE('Segment (Control)','Segment (Control)'[Segment]), "Vol/Mix New2", Calculate([Vol/Mix Impact])), [Vol/Mix New2])))
[Vol/Mix Impact],
SumX( ADDCOLUMNS(SUMMARIZE('Segment (Control)','Segment (Control)'[Segment]), "Vol/Mix New2", Calculate([Vol/Mix Impact])), [Vol/Mix New2])))
return
result
misharaina
4 years agoAdvocate I
Thank you Anonymous ! I also want to check if the parameter value = "Segment" but it doesn't seem to work.
Vol/mix new =
var valparameter=SELECTEDVALUE('Parameter'[Parameter1])
var result =if(HASONEVALUE('Segment (Control)'[Segment]) ,
[Vol/Mix Impact],
SumX( ADDCOLUMNS(SUMMARIZE('Segment (Control)','Segment (Control)'[Segment]), "Vol/Mix New2", Calculate([Vol/Mix Impact])), [Vol/Mix New2]))
Return (IF (valparameter = "Segment", result, 0))