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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.