Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
50 | |
45 | |
38 | |
38 |