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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
telbin
New Member

Match records on two variables

Hi, i'm looking for a bit of help please.  I am new to powerbi, and would like to know if the following functionaliy is avaibale.

 

I need to mach two tables, based on employee number and also a varible date, see table below. 

 

ho do i return the expected resuts?

 

thanks in advance.

 

Employee NoStart DateEnd DateArea / Code   Employee NoDateExpected Result
12345601/01/201803/01/2018100   12345603/01/2018100
12456620/02/201820/02/2018500   12345620/02/2018(blank)
453212      12345610/01/2018300
12345604/01/201815/02/2018300   12345612/01/2018300
       45321226/02/2018(blank)
       12456726/02/2018(blank)
4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @telbin,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-danhe-msft
Employee
Employee

Hi, Due to the Employee No in Table 1 has two "123456" number and related two different [Start Date] and [End Date], I could not figure out which date should be compared? Could you please offer me more information about your data logic? Regards, Daniel He
Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
telbin
New Member

sorry shoud have explained. Table 1 is the first 4 columns, and the second table is Employee No, Date and Expected Results

@telbin

 

 

Try this column in Table 2

 

Column in Table2 =
CALCULATE (
    MIN ( Table1[Area / Code] ),
    FILTER (
        Table1,
        Table1[Employee No] = Table2[Employee No]
            && Table2[Date] >= Table1[Start Date]
            && Table2[Date] <= Table1[End Date]
    )
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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