Forum Discussion
Anonymous
4 years agoNot applicable
Adding two measures within an IF statement
Help! I'm trying to create a calculated column using an IF statement and need to add together 2 measures and compare the points value. Both measures are based on the "Points" column. The standard dev...
- 4 years ago
The standard deviation and average measures are being computed in the current row context, they are not being computed against the whole dataset.
You'll need something like
Tier = VAR _stdDev = CALCULATE ( [Standard deviation], ALL () ) VAR _avg = CALCULATE ( [Average], ALL () ) RETURN IF ( 'ASG Contribution Points'[Points] > ( _stdDev + _avg ), "S", "V" )
johnt75
4 years agoSuper User
The standard deviation and average measures are being computed in the current row context, they are not being computed against the whole dataset.
You'll need something like
Tier =
VAR _stdDev =
CALCULATE ( [Standard deviation], ALL () )
VAR _avg =
CALCULATE ( [Average], ALL () )
RETURN
IF ( 'ASG Contribution Points'[Points] > ( _stdDev + _avg ), "S", "V" )
Anonymous
4 years agoNot applicable
I tried exactly that and am recieving this error:
The syntax for 'stdDev' is incorrect. (DAX(VAR stdDev = CALCULATE('ASG Contribution Points'[Standard Deviation], ALL())VAR avg = CALCULATE('ASG Contribution Points'[Average],ALL())RETURN IF ('ASG Contribution Points'[Points] > (stdDev + avg), "S", "V"))).
- johnt754 years agoSuper User
can you post a screenshot of the measure definition you are using?