Forum Discussion

z29n's avatar
z29n
Regular Visitor
1 year ago
Solved

help needed - difference btw columns

Hello there,    I am trying to create a new measure to calculate difference btw two columns in absolute and % for each year.  LYOP and OP are Types.  Could you please help me on this? I do not ho...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Try using the following DAX formula.

    Negative vari = 
    var _lyop = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "LYOP")
    var _op = CALCULATE(SUM('Table 2'[Rev]), 'Table 2'[Type] = "OP")
    RETURN
    IF(SELECTEDVALUE('Table 2'[Type]) = "OP", _lyop - _op, BLANK())

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • z29n's avatar
    z29n
    1 year ago

    no, what I mean is I would like to see the difference OP minus LYOP in a format that either negative or positive based on figures- not only negative ones or not in absolute form. Is it clear?