Forum Discussion

socialengaged's avatar
socialengaged
New Member
8 years ago
Solved

OR

Hello

Can you please help me out with this formula? 

 

(if Text.Contains([Custom], "cloud", Comparer.OrdinalIgnoreCase) then "Cloud"
else if Text.Contains([Custom], "nuvola", Comparer.OrdinalIgnoreCase) then "Cloud"
else null) or (if Text.Contains([Custom], "ecommerce", Comparer.OrdinalIgnoreCase) then "ecommerce"
else if Text.Contains([Custom], "ecommerce", Comparer.OrdinalIgnoreCase) then "ecommerce"
else null)

 

The OR does not work. My wanted output should be 

 

Cloud | ecommerce (for some cells)

Cloud (for some cells)

ecommerce (for some cells)

 

Thanks

Eugenio

  • socialengaged,

     

    You may add a custom column as follows.

    = Text.Combine(
    {
    (if Text.Contains([Custom], "cloud", Comparer.OrdinalIgnoreCase) then "Cloud"
    else if Text.Contains([Custom], "nuvola", Comparer.OrdinalIgnoreCase) then "Cloud"
    else null)
    , (if Text.Contains([Custom], "ecommerce", Comparer.OrdinalIgnoreCase) then "ecommerce"
    else null)
    }
    , " | "
    )

2 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    socialengaged,

     

    You may add a custom column as follows.

    = Text.Combine(
    {
    (if Text.Contains([Custom], "cloud", Comparer.OrdinalIgnoreCase) then "Cloud"
    else if Text.Contains([Custom], "nuvola", Comparer.OrdinalIgnoreCase) then "Cloud"
    else null)
    , (if Text.Contains([Custom], "ecommerce", Comparer.OrdinalIgnoreCase) then "ecommerce"
    else null)
    }
    , " | "
    )