Forum Discussion
Concatenate Values from one Table based on the values in two fields in Another Table.
I feel like this is a simple issue to resolve, I just have not had success.
I would like to show the results from two fields (Table Y [Status.1 & Status.2] based on the result of a column in a different table (Table X[Type])
Resulting in a new Column that would be kept in Table X if possible
Example If a row in Table X has a value of "A" in 'Type' the result would show the Value of "Status.1"
Sample Data
Table X Table Y
Relationship Value Type Relationship Value Status.1 Status.2
1 A 1 G R
2 B 2 G
2 A 3 R
4 A 4 Y
I tried the calculation but it did not work
If(Table X[Type] = "A",LOOKUPVALUE(Table Y[Status.1],Table X[Type],"B"),LOOKUPVALUE(Table Y[Status.2],Table X[Type],"B"))
Thank you for your help
If the relationship between X and Y is 1:1 or Many:1, you can use the RELATED function as follows
NewColumn on IF(TableX[Type] on "A", RELATED(TableB[Status.1]), RELATED(TableB[Status.2]))
If Y is on the side of many of the relationship, you can do something similar but THE RELATEDTABLE.
Best regards
Pat
2 Replies
- mahoneypat
Microsoft Employee
If the relationship between X and Y is 1:1 or Many:1, you can use the RELATED function as follows
NewColumn on IF(TableX[Type] on "A", RELATED(TableB[Status.1]), RELATED(TableB[Status.2]))
If Y is on the side of many of the relationship, you can do something similar but THE RELATEDTABLE.
Best regards
Pat
- amitchandak
Super User
Brett007 , Try a new column like
if(X[Type] ="A" ,maxx(filter(Y,Y[Relationship Value] =X[Relationship Value]),[Status.1]),maxx(filter(Y,Y[Relationship Value] =X[Relationship Value]),[Status.2]))
Refer my video how to copy values from one table to another https://www.youtube.com/watch?v=czNHt7UXIe8