Forum Discussion

venyamu's avatar
venyamu
New Member
2 years ago
Solved

multiple condition with search/filter condition

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 RequestRequest DetailsCode wordCode wordCode word
Account DetailsAccount IDBPID createAccountBPID Setup
Account DetailsContractscontractAgreementMDA
  • Anonymous's avatar
    Anonymous
    2 years ago

    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.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.