Forum Discussion

amandabus21's avatar
amandabus21
Helper V
3 years ago
Solved

COnditonal Column

How can I change this formula so that it only calculates if the previous Equipment Key does not equal the next Equipment Key.  It then should be 0.   Variable Difference =     VAR curr =      ...
  • tamerj1's avatar
    tamerj1
    3 years ago

    amandabus21 

    Please try

    MeasureDifference =
    VAR FirstSelectedDate =
    CALCULATE (
    MIN ( 'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01] ),
    ALLSELECTED (),
    VALUES ( 'PM On Time Performance Bus PM-BI-002 (2)'[Equipment.Equipment Level 01.Key] )
    )
    RETURN
    SUMX (
    'PM On Time Performance Bus PM-BI-002 (2)',
    IF (
    'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01] = FirstSelectedDate,
    0,
    'PM On Time Performance Bus PM-BI-002 (2)'[Variable Difference]
    )
    )