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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
EnrichedUser
Helper III
Helper III

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")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@EnrichedUser , Try a new column in SalesOrder

 

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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