Forum Discussion

saipawar's avatar
saipawar
Helper IV
5 years ago
Solved

how to create case statement with else

How to create a case statement with "else" of SQL? I would like to create a new measure or column with two groups -  a) Launch Content  b) Not launch content Here's how my data looks -  Launc...
  • Icey's avatar
    5 years ago

    Hi saipawar ,

     

    If you want to create a custom column in Power Query, try this:

    • Create a conditional column.

     

    • Or, create a custom column.
    = if Text.Contains([Launch Content],"Not launch related") then "Not considered" else "Considered Content")

     

    If you want to create a calculated column in data view, try this:

    Is Launch Content = 
    IF (
        CONTAINSSTRING ( [Launch Content], "Not launch related" ),
        "Not considered",
        "Considered Content"
    )
    Is Launch Content 2 = 
    IF (
        FIND ( "Not launch related", [Launch Content],, 0 ) <> 0,
        "Not considered",
        "Considered Content"
    )
    Is Launch Content 3 = 
    IF (
        SEARCH( "Not launch related", [Launch Content],, 0 ) <> 0,
        "Not considered",
        "Considered Content"
    )

     

     

    Best Regards,

    Icey

     

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