Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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. If the Pin is Stud or Studless, then the result shall be "Stud" or "Studless".
3. Else, it shall follow Category, either "PR" or "LT".
| No | Category | Rank | Pin | Desired Outcome |
| Y1 | PR | RE | Others | PR |
| N3 | PR | RE | Stud | Stud |
| P1 | PR | OE | Others | OE |
| S1 | LT | RE | Studless | Studless |
| A2 | LT | RE | Others | LT |
Thanks.
Regards, LC
Solved! Go to Solution.
@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
Proud to be a Super 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
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 6 | |
| 6 |