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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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