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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Raif8522
Frequent Visitor

Search Keyword from another Table and retrieve values

Hi Everyone,

 

i was trying to write a Dax formula to search a Keyword from Table B in "Comments" column on Table A and retrieve a "Date Open" & "Date Closed" values.

i tried to use  =Calculate(Firstnonblank([TableA],Filter([TableA],Search("Reference","Comments">0),ProductID))) but after SEARCH commend, "Reference" column is not available.

Table A    
Date OpenDate ClosedIncident IDProduct IDComments
01/11/202201/12/20222122*****20221101-212-Screen Error*****
10/09/202110/10/20222122*****20211009-212-NoPrint*****
01/01/2023 2151*****20230101-215-ResistorFailure*****
12/12/202214/12/20222173*****20221212-217-NoError******
01/07/202208/07/20222122*****20220701-212-Unknown*****

 

Table B   
Date OpenDate ClosedProduct IDReference
??21220221101-212-Screen Error
??21720221212-217-NoError
??21220220701-212-Unknown

 

 Anyone here can help me with the formula or if you think PowerQuery will be better?

 

Many Thanks in advance.

6 REPLIES 6
BeaBF
Impactful Individual
Impactful Individual

@Raif8522 Hi! 

So you want to search for a word from the Reference column of Table B in the Comments column of Table A then taking the respective Date Open and Closed?

 

BBF

Yes, that's correct. column "Comments" on Table B is a text field where **** represents texts. 

i am going to check your solution below. 

Much appreciated for your response.

 

Thansk

 

BeaBF
Impactful Individual
Impactful Individual

@Raif8522 I have done that in Power Query, look at the attached pbix.

If that's correct, accept my answer as a solution.

 

BBF

Sorry my bad, forgot to mention that *** are texts, basically it's comments from customers. But reference on the "comments" column Table A & text on the "Reference" column Table B are unique.

I used SEARCH function to find the Reference in Comments column on Table A and retrieve Date Open & Date Closed values into Table B, but wasn't successful. 😕

BeaBF
Impactful Individual
Impactful Individual

@Raif8522 ok, calculate a new column in Table B as follow:

 

Date Open Tab A = MINX (
FILTER ( 'Table A', SEARCH ( 'Table B'[Reference], 'Table A'[Comments], 1, 0 ) > 0 ),
'Table A'[Date Open]
)
 
Do the same for the other one. Does it work?
 
BBF

@BeaBF 

Thanks for the formula. 

 

I added to the table and it is "Working onit" for last 2 hrs.

 

i think my Data set is way to large for the formula.

 

i have over 2mil records on Table A 😕

 

but, many thanks again for your respond 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors