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
KarlConstruct
Frequent Visitor

Create new Column from Existing Data if Values are Found

Hi All, 

 

I've created a new column that searches the text of another column and if any of the text matches another table I have setup, then it returns that value. 

 

The new column is: 

 

Comments By = VAR result = 
CONCATENATEX('ID Matrix',IF(SEARCH(FIRSTNONBLANK('ID Matrix'[ID Extract],1),'Tracked Issues'[Description],,999) <> 999,'ID Matrix'[ID Extract],"")) Return IF( result <> Blank(),result,"Not Found")

 

 

The ID table looks like this. 

ID Matrix.png

 

My end result is this (below) with a new column being added that displays the inspectors initials if they've added them at the end of their description. As you can see its also finding those same matches in the middle of other words and then combines the two in the new column.  

name extract.png

 

I know this has to be fairly simple, i'm still very new and more complex power BI so any help would be greatly appreciated!!

 

1 ACCEPTED SOLUTION

I think you've removed a comma when editing the formula. The part before the <> should be

RIGHT('Tracked Issues'[Description],3),,999)

 

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

I suppose you could limit the search by replacing the text to be searched  

'Tracked Issues'[Description]

with

RIGHT('Tracked Issues'[Description],3)

 

 Feel free to experiment

That makes a lot of sense to limit the search to the last few characters as thats where they typically leave their initials. Thank you for that. 

 

I seem to be doing something wrong here, any thoughts on my code? 

name extract 2.png

 

thank you!

I think you've removed a comma when editing the formula. The part before the <> should be

RIGHT('Tracked Issues'[Description],3),,999)

 

That worked thank you! 

 

Not sure if there is an easier way to do this in powerBI but this will work fine for now! 

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.