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
powerbiqu
Frequent Visitor

Using two columns in two tables to find matching records

Hello all!

I am having some trouble with the logic behind how to solve this. 

I have two tables where I am tring to match records based on ticket numbers, but due to typos and other things there are records that do not have matching ticket numbers. However, the Prop ID will match exactly, and ticket date on the first table will always be one day before the ticket date on the second table. 

Example Table 1:

 

Ticket NumberTicket DateProp ID
55582111/11/22WW555
10199110/20/22WW001
80855412/12/22WW333



Example Table 2:

Ticket NumberTicket DateProp ID
542111/12/22WW555
1907/1/22WW001
80050012/13/22WW333




In the two examples above, the first and third records would link because the prop ID matches and the date is 1 day apart. The middle row would not link because the date is off. 

Can anyone help with what the syntax for this might be? It would be fine if it either created a column that said "Match" or "No match" beside the records, or if it only returned records with a match. Really just any help getting it filtered would be great. Thank you!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @powerbiqu 

You can create a calculated column in Table2 as follows 

Matching Ticket =
MAXX (
FILTER (
Table1,
Table1[Prop ID] = Table2[Prop ID]
&& Table1[Ticket Date] = Table2[Ticket Date] - 1
),
Table1[Ticket Number]
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @powerbiqu 

You can create a calculated column in Table2 as follows 

Matching Ticket =
MAXX (
FILTER (
Table1,
Table1[Prop ID] = Table2[Prop ID]
&& Table1[Ticket Date] = Table2[Ticket Date] - 1
),
Table1[Ticket Number]
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors