Forum Discussion
telbin
8 years agoNew 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 No | Start Date | End Date | Area / Code | Employee No | Date | Expected Result | |||
| 123456 | 01/01/2018 | 03/01/2018 | 100 | 123456 | 03/01/2018 | 100 | |||
| 124566 | 20/02/2018 | 20/02/2018 | 500 | 123456 | 20/02/2018 | (blank) | |||
| 453212 | 123456 | 10/01/2018 | 300 | ||||||
| 123456 | 04/01/2018 | 15/02/2018 | 300 | 123456 | 12/01/2018 | 300 | |||
| 453212 | 26/02/2018 | (blank) | |||||||
| 124567 | 26/02/2018 | (blank) |
4 Replies
- telbinNew Member
sorry shoud have explained. Table 1 is the first 4 columns, and the second table is Employee No, Date and Expected Results
- Zubair_Muhammad
Community Champion
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] ) )
- v-danhe-msft
Microsoft 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 - v-danhe-msft
Microsoft 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