Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have 2 tables as defined below.
Table 1:
| ID | Date | Dept | 
| 1 | 2022/02 | A | 
| 2 | 2022/02 | A | 
| 3 | 2022/02 | B | 
| 4 | 2022/02 | B | 
| 1 | 2022/03 | A | 
| 2 | 2022/03 | A | 
| 3 | 2022/03 | B | 
| 4 | 2022/03 | C | 
| 1 | 2022/04 | C | 
| 2 | 2022/04 | A | 
| 3 | 2022/04 | D | 
| 4 | 2022/04 | C | 
Table 2
| ID | Date | 
| 1 | 2022/04 | 
| 2 | 2022/03 | 
| 3 | 2022/02 | 
| 4 | 2022/04 | 
So, I want to add Dept column in Table 2 such that it matches with ID & Date of Table 1. For example if I add a new Dept column for Table 2 it will be like:
| ID | Date | Dept | 
| 1 | 2022/04 | C | 
| 2 | 2022/03 | A | 
| 3 | 2022/02 | B | 
| 4 | 2022/04 | C 
 | 
Any idea how I can achieve this?
Solved! Go to Solution.
Dept =
var currentID = 'Table 2'[ID]
var currentDate = 'Table 2'[Date]
return LOOKUPVALUE( 'Table 1'[Dept', 'Table 1'[ID], currentID, 'Table 1'[Date], currentDate)Dept =
var currentID = 'Table 2'[ID]
var currentDate = 'Table 2'[Date]
return LOOKUPVALUE( 'Table 1'[Dept', 'Table 1'[ID], currentID, 'Table 1'[Date], currentDate) 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 84 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |