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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sayang194
Frequent Visitor

Add custom column

I have 2 tables as defined below.

 

Table 1:

IDDateDept
12022/02A
22022/02A
32022/02B
42022/02B
12022/03A
22022/03A
32022/03B
42022/03C
12022/04C
22022/04A
32022/04D
42022/04C

Table 2

IDDate
12022/04
22022/03
32022/02
42022/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:

IDDateDept
12022/04C
22022/03A
32022/02B
42022/04

C

 

 

Any idea how I can achieve this?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Dept =
var currentID = 'Table 2'[ID]
var currentDate = 'Table 2'[Date]
return LOOKUPVALUE( 'Table 1'[Dept', 'Table 1'[ID], currentID, 'Table 1'[Date], currentDate)

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Dept =
var currentID = 'Table 2'[ID]
var currentDate = 'Table 2'[Date]
return LOOKUPVALUE( 'Table 1'[Dept', 'Table 1'[ID], currentID, 'Table 1'[Date], currentDate)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.