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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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