Forum Discussion

varunv11's avatar
varunv11
Frequent Visitor
8 years ago
Solved

Finding Max Value

Hello,    I am trying to create a DAX which will find the Max value between 2 different columns. Excel for and screenshot given below,          Please advice.    Warm Regards  Varun R...
  • OwenAuger's avatar
    OwenAuger
    8 years ago

    Hi varunv11

     

    The calculated column you want to add is really just the maximum value so far in the P/L $ column.

     

    You could use a DAX calculated column like this:

    Max so far = 
    VAR CurrentDateTime = Data[Date] + Data[Time]
    RETURN
        CALCULATE (
            MAX ( Data[P/L $] ),
            ALL ( Data ),
            FILTER (
                ALL ( Data[Date], Data[Time] ),
                Data[Date] + Data[Time]
                    <= CurrentDateTime
            )
        )

    Regards,

    Owen