Forum Discussion

HenryJS's avatar
HenryJS
Post Prodigy
6 years ago
Solved

New Column: Return Only Selected Text

Hi all,

 

Is it possible to create a new column which returns on the specified text from one column if present?

 

For example, below would be "KP - Section Engineers" and the new column would only show that if present

 

Would be blank for else

 

 

 

Thank you

  • hi  HenryJS 

    You could use SEARCH or FIND function to create a new calculated column as below:

    https://docs.microsoft.com/en-us/dax/search-function-dax

    https://docs.microsoft.com/en-us/dax/find-function-dax

    Note: The SEARCH function is case insensitive. Searching for "N" will find the first occurrence of 'N' or 'n'.

     

    For example:

    FIND:

    Column 1 =IF( FIND("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), "KP - Section Engineers")
    
    or
    
    Column 2 = IF( FIND("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), [Profile Skills])

     

    SEARCH:

    Column 3 = IF( SEARCH("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), "KP - Section Engineers")
    
    or
    
    Column 4 = IF( SEARCH("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), [Profile Skills])

     

    Regards,

    Lin

2 Replies

  • camargos88's avatar
    camargos88
    Community Champion

    Hi HenryJS ,

     

    You can do it using Power Query, using the function Text.Contains.

     

    Ricardo

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

    hi  HenryJS 

    You could use SEARCH or FIND function to create a new calculated column as below:

    https://docs.microsoft.com/en-us/dax/search-function-dax

    https://docs.microsoft.com/en-us/dax/find-function-dax

    Note: The SEARCH function is case insensitive. Searching for "N" will find the first occurrence of 'N' or 'n'.

     

    For example:

    FIND:

    Column 1 =IF( FIND("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), "KP - Section Engineers")
    
    or
    
    Column 2 = IF( FIND("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), [Profile Skills])

     

    SEARCH:

    Column 3 = IF( SEARCH("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), "KP - Section Engineers")
    
    or
    
    Column 4 = IF( SEARCH("KP - Section Engineers",[Profile Skills],1,0)=0,BLANK(), [Profile Skills])

     

    Regards,

    Lin