Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HenryJS
Post Prodigy
Post Prodigy

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

 

Capture2.JPG

 

 

Thank you

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
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

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

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
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

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
camargos88
Community Champion
Community Champion

Hi @HenryJS ,

 

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

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.