Forum Discussion

matheus_peppers's avatar
matheus_peppers
Frequent Visitor
3 years ago
Solved

How to use CONTAINSTRING inside SWITCH?

Hello everybody, how are you?   I need your help urgently for a problem I'm having.   I have a column with different values, but with a specific string that repeats in more than one row.   What...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  matheus_peppers ,

    Here are the steps you can follow:

    1. Create calculated column.

    Column =
    SWITCH(
        TRUE(),
    CONTAINSSTRING('Table'[Anuncio],"Taubate")=TRUE(),"Taubate",
    CONTAINSSTRING('Table'[Anuncio],"Canas")=TRUE(),"Canas")

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly