Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX to retrive a value from multiple column based on condition.

Hello Community,   I need help in writing a DAX for retrieving a value from multiple column based on condition.   For example from column "Name" i need to select only Alice and display the sum of...
  • amitchandak's avatar
    4 years ago

    Anonymous , New measure 

    = sum(Table[Salary])  + Sum(Table[Bonus])

     

    If you need you column

     

    Sumx(filter(Table, [Name] + earlier([Name]) ) , [Salary] +[Bonus])

  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

    Total CC =
    VAR _condition = Data[Name] = "Alice"
    RETURN
        ( Data[Salary] + Data[Bonus] )
            * DIVIDE ( _condition, _condition )