Forum Discussion

Tan_LC's avatar
Tan_LC
Helper II
2 years ago
Solved

Compare multiple columns in same table

Hi, in below table, I would like to retrieve a string value by comparing to the other 3 columns, Category, Rank & Pin with below conditions:   1. If the Rank is "OE", then the result shall be "OE"....
  • bhanu_gautam's avatar
    2 years ago

    Tan_LC , You can get the desired result by creating a custome column go to modelling view select new column

     

    dax
    DesiredOutcome =
    SWITCH(
    TRUE(),
    'YourTable'[Rank] = "OE", "OE",
    'YourTable'[Pin] = "Stud", "Stud",
    'YourTable'[Pin] = "Studless", "Studless",
    'YourTable'[Category] = "PR", "PR",
    'YourTable'[Category] = "LT", "LT",
    BLANK()
    )

     

    Replace table name