Forum Discussion

tmacfrank's avatar
tmacfrank
Frequent Visitor
8 years ago
Solved

Replace mutilple values in a column

Hi,

 

I want all that contian "Deposit" in column [type] become "Deposit" in a new column. Others remain the same.

Any hint for DAX ? 

 

type                             new type

 

Deposits-blend           Deposit

bills                             bills

withdraws                   withdraws

mail Deposits             Deposit

 

 

Thanks a lot !

  • Anonymous's avatar
    Anonymous
    8 years ago

    tmacfrank try using the search function

     

    newtype = IF(SEARCH("Deposit",table1[type],1,0),"Deposit",table1[type])

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    tmacfrank try using the search function

     

    newtype = IF(SEARCH("Deposit",table1[type],1,0),"Deposit",table1[type])

    • tmacfrank's avatar
      tmacfrank
      Frequent Visitor

      Works perfectly, Thanks a lot.

       

      However, I cannot search two or more values at one time, don't I.

      for example 

      newtype = IF(SEARCH("Deposit" or "Dep",table1[type],1,0),"Deposit",table1[type]), do i need one more if for searching "Dep". Thanks

      • Anonymous's avatar
        Anonymous
        Not applicable

        tmacfrank umm try like a normal or

         

        IF(OR(SEARCH("Deposit",col1,1,0),SEARCH("Dep",col1,1,0),"Depost", col1)