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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Solution Sage
Solution Sage

@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

 

@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. 😕

@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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Kudoed Authors