Forum Discussion
Lookup multiple values in a column
Hi All
I need a DAX to look up the values in column A then create another column B as shown below.
I know I can use if(search in DAX however I just wonder is there a quicker way like something to group them with 'Or', e.g. if(or(search"Apple", "apple").... to be more effective? Many thanks.
| Column A | Column B |
| Apple | Apple |
| apple | Apple |
| Boy | Boy |
| boy is playing | Boy |
| Girl | Girl |
| Playing (girls) | Girl |
| I prefer not to say | Not known |
| Not known | Not known |
| Other | Other |
5 Replies
- Apple08
Helper IV
Thanks, I like a DAX to include the rest as well, e.g. 'Girl' or 'playing (girls) then 'Girl'
- Smalfly
Responsive Resident
Then the SWITCH function is what you are looking for:
https://learn.microsoft.com/en-us/dax/switch-function-dax
- Apple08
Helper IV
I wonder search function is more appropriate to look for any specific value within the text. As I need to look for the specific value within long text.
- AnonymousNot applicable
Hi Apple08,
Perhaps you can use 'upper' or 'lower' or not 'case sensitive' function to processing the feild strings before check it, they should help you to skip some simple difference in search.
UPPER function (DAX) - DAX | Microsoft Learn
LOWER function (DAX) - DAX | Microsoft Learn
SEARCH function (DAX) - DAX | Microsoft Learn
Then you can setting a default values to the search result with if statement to handle 'not found' results.
Regards,
Xiaoxin Sheng