Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • johnt75's avatar
    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" )