Forum Discussion
how to create case statement with else
- 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.
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.
Icey Thanks a lot for laying out all the options. Your is one of the best solutions I've come across in the community to date.
I went with the conditional column approach and it worked. Thanks.
Ultimately, after grouping 'Considered" and "Not considered" values, I would like to put them in a table against the months.
Here's my desired output -
| Month | Considered | Not considered |
| January | 12 | 4 |
| February | 2 | 7 |
| March | 23 | 1 |
How can I achieve this?
Currently, when I pull the new column in values, I can use it only once to filter the data either for "Considered" or "Not considered".
Do I need to create 2 different conditional columns then? or please recommend the best approach.
Thanks again