Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
Can anyone help me with the below?
I'm trying to add a column with the below condition.
If column [Type of Request] = "Account Details"
Then
Search column [Type] for word BPID create or Account or BPID setup
If yes, return the Account ID
else, Search column [Type] for word contract, Agreement, MDA
...
Else If column [Type of Request] = "Business"
and so on
| Type of Request | Request Details | Code word | Code word | Code word |
| Account Details | Account ID | BPID create | Account | BPID Setup |
| Account Details | Contracts | contract | Agreement | MDA |
Solved! Go to Solution.
Hi @venyamu ,
I have processed the data you provided using power query, please check if the following results are as you expected:
Measure = var _T = SELECTEDVALUE('Table'[Type of Request])
RETURN SWITCH(TRUE(),_T="Account Details" &&MAX('Table'[Type]) IN{"BPID create","Account","BPID setup"},"Account ID",
_T="Account Details" &&MAX('Table'[Type]) IN{"contract","Agreement","MDA"},"Contracts")
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @venyamu ,
I have processed the data you provided using power query, please check if the following results are as you expected:
Measure = var _T = SELECTEDVALUE('Table'[Type of Request])
RETURN SWITCH(TRUE(),_T="Account Details" &&MAX('Table'[Type]) IN{"BPID create","Account","BPID setup"},"Account ID",
_T="Account Details" &&MAX('Table'[Type]) IN{"contract","Agreement","MDA"},"Contracts")
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.