Forum Discussion
saipawar
Helper IV
6 years agohow 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...
- 6 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.
saipawar
Helper IV
6 years agoThis gives an error saying "Unexpected expression THEN" and "Syntax for THEN is incorrect"
Is there any other alternative to this?
samdthompson
Memorable Member
6 years agoSorry. case sensitive
Is Launch Content =
IF [Launch Content]="Not launch related"
then "Not considered"
else "Considered Content"
// if this is a solution please mark as such. Kudos always appreciated