Forum Discussion
Tan_LC
2 years agoHelper II
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"....
- 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
bhanu_gautam
2 years agoSuper User
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