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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dexter1088
Frequent Visitor

Add New Column to Table using 2 IF Statements...

Hi There, 
I been trying to find the answer to this with no luck and I know I'm just overlooking the obvious. 

 

My 2 tables look like this

Table 1		
ID	Project	Status
1	Build	Pending
2	Walk	Complete
3	Build	Pending
4	Walk	Complete
5	Walk	Pending
		
Table 2		
ID	Project	
1	Build	
2	Build	
1	Walk	
4	Build	
3	Walk	
3	Build	
4	Walk	
5	Build	
5	Walk	
2	Walk	

I already have a relationship built betweed the table ID's but I can't add a 2nd relationship with the "Project" column.
I Need to add a column to table 2 that will make sure the Table ID & Project match to add the status. 

Any help would be greatly appreciated!, Thanks!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Dexter1088 

You can pull the value over using the following as a calculated column in Table2.

Status Lookup = LOOKUPVALUE(Table1[Status],Table1[ID],Table2[ID],Table1[Project],Table2[Project])

You could also create a calculated column in both Table1 and Table2 that combines ID and Project into a single field an join the two tables on that.

join key.jpg

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @Dexter1088 

You can pull the value over using the following as a calculated column in Table2.

Status Lookup = LOOKUPVALUE(Table1[Status],Table1[ID],Table2[ID],Table1[Project],Table2[Project])

You could also create a calculated column in both Table1 and Table2 that combines ID and Project into a single field an join the two tables on that.

join key.jpg

works perfect!
I was trying the same thing just had my tables out of order. Thanks!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.