cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EnrichedUser
Helper I
Helper I

Measure: Find Partial Text in Unrelated Table

Hi,

 

I have two unreleated tables with 1 common field.

My goal is to create a measure that can identify, for any given SalesOrderID, if there exists a partial match for "Order added to warehouse" in another table's "Message" column. 

 

Table1: ApplicationAudit

BranchIDApplicationIDTransactionNumberMessageModAtAutoID
SF01SALESORDER1118778Order added to warehouse order 00035991.12/30/2020 8:5117898821
SF01SALESORDER1056768Order added to warehouse order 00036431.1/8/2021 14:1818141984
SF01SALESORDER1118781Order added to warehouse order 00037859.2/4/2021 14:4018944137
DADFSALESORDER1118628Order added to warehouse order 00036097.1/4/2021 10:1417958991
DADFSALESORDER1118628To Bin: SHIP011/4/2021 13:3217970590

 

Table2:SalesOrder

BranchIDSalesOrderID
RK101123590
DADF1123552
SF011056768
SF011118778
DADF1118628

 

Expected Output (messure):

BranchIDSalesOrderIDAdded to warehouse
RK101123590NO
DADF1123552NO
SF011056768YES
SF011118778YES
DADF1118628YES

 

Notes:

 

Both tables have additional fields but ApplicationAudit.TransactionNumber = SalesOrder.SalesOrderID

 

SalesOrderIDs 1056768, 1118778 and 1118628 have "Yes" under "Added to warehouse" because in the applicationaduit table, the same TransacationNumber has a log under the message column for "Order added to warehouse"


SalesOrderID and TransactionNumber have duplicates in each table

 

Added to warehouse =
IF(ISBLANK(
MINX(
FILTER(ApplicationAudit, SEARCH("Order added",ApplicationAudit[Message],1,0) > 0 ),
SalesOrders[Lines])),
"YES",
"NO")
1 ACCEPTED SOLUTION

@EnrichedUser , Try some thing like 

 

if(isblank(countx(filter(ApplicationAudit,SalesOrder[SalesOrderID] = ApplicationAudit[TransactionNumber] && search("Order added to warehouse", ApplicationAudit[Message],,0) >0),ApplicationAudit[Message])), "No", "Yes")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

3 REPLIES 3
amitchandak
Super User IV
Super User IV

@EnrichedUser , Try a new column in SalesOrder

 

if(isblank(countx(filter(ApplicationAudit,search(SalesOrder[SalesOrderID], ApplicationAudit[Message],,0) >0),ApplicationAudit[Message])), "No", "Yes")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Hi @amitchandak 

Thank you for your quick reply. Unfortuntaly, this was not able to resolve.

looking at your dax:
if(isblank(countx(filter(ApplicationAudit,search(SalesOrder[SalesOrderID], ApplicationAudit[Message],,0) >0),ApplicationAudit[Message])), "No", "Yes")

it does not take into account the message field for "Order added to warehouse"

 

Also, SalesOrderID would not be in Message but TranscationNumber

@EnrichedUser , Try some thing like 

 

if(isblank(countx(filter(ApplicationAudit,SalesOrder[SalesOrderID] = ApplicationAudit[TransactionNumber] && search("Order added to warehouse", ApplicationAudit[Message],,0) >0),ApplicationAudit[Message])), "No", "Yes")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.