cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dexter1088 Frequent Visitor
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

Accepted Solutions
Super User IV
Super User IV

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

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
Super User IV
Super User IV

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

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

Dexter1088 Frequent Visitor
Frequent Visitor

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

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

 

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors