Forum Discussion

Sridharkrish's avatar
Sridharkrish
New Member
3 years ago
Solved

Regarding Max Condition with multiple condition

Hi All, I have a table consisting of name, CRM number and a phase where I need to find the max value of the CRM number. I have three conditions here : I want DAX in PowerBi. If a name has only agre...
  • FreemanZ's avatar
    3 years ago

    hi Sridharkrish 

     

    try to add a column with this:

    MaxValue =
    VAR _MaxValue1 =
    CALCULATE(
        MAX(TableName[CRM]),
        ALLEXCEPT(TableName, TableName[Name])
    )
    VAR _MaxValue2 =
    CALCULATE(
        MAX(TableName[CRM]),
        ALLEXCEPT(TableName, TableName[Name]),
        TableName[Phase]="Agreement"
    )
    RETURN
        IF(
            _MaxValue2<>0,
            IF(TableName[CRM]=_MaxValue2, "MAX"),
            IF( TableName[CRM]=_MaxValue1, "MAX")
        )
     
    i tried and it worked like this: