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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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")

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.