Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I am trying to append a column to a table with values from another unrelated table. I have tried a few of suggestions found in other threads but they don't quite deliver the correct value. The main issue as there is no way I can see to create a relationship due to duplicate values.
As an example I would like to append the "Size" column from Table 2 into table 1 based on the UserID and Variety from table 1 matching the UserID and Variety from table 2.
Table 1 Fields have duplicate values.
Table 1:
User ID, Variety
1, Gold
1,Gold
1,Gold
1,Silver
2, Gold
2,Gold
2,Silver
2,Silver
3, Gold
1, Silver
2, Silver
2, Silver
Table 2:
UserID, Variety, Size
1,Gold, 27.95
1,Silver, 22.50
2,Gold, 28.00
2,Silver, 23.00
3,Gold, 29.00
3,Silver, 23.50
The end result should look:
User ID, Variety, Size
1, Gold,27.95
1,Gold,27.95
1,Gold,27.95
1,Silver,22.50
2, Gold,28.00
2,Gold,28.00
2,Silver,23.00
2,Silver,23.00
3, Gold,29.00
1, Silver,22.50
2, Silver,23.00
2, Silver,23.00
Any ideas or assistance greatly appreciated.
Regards
Imperial56
Solved! Go to Solution.
You can add a calculated column in Table 1 to LOOKUP the size from Table 2 using LOOKUPVALUE function
size =
LOOKUPVALUE (
Table2[Size],
Table2[UserID], Table1[User ID],
Table2[Variety], Table1[Variety]
)
Hi @Imperial56
This version of a calcualted column won't break if your lookup table returns multiple results.
New Column = MINX(
FIlTER(
'Table2',
'Table2'[User ID]=EARLIER('Table1'[User ID]) &&
'Table2'[Variety] = EARLIER('Table1'[Variety])
),
'Table2'[Size])
I would recommend to create key in both the tables by concatenating userid + variety and set relationship on this new key column, then it is much easier.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
Using the Query Editor, simply join the two tables based on User ID and variety.
Hi @Imperial56
This version of a calcualted column won't break if your lookup table returns multiple results.
New Column = MINX(
FIlTER(
'Table2',
'Table2'[User ID]=EARLIER('Table1'[User ID]) &&
'Table2'[Variety] = EARLIER('Table1'[Variety])
),
'Table2'[Size])
I would recommend to create key in both the tables by concatenating userid + variety and set relationship on this new key column, then it is much easier.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
You can unwittingly introduce key collisions and other issues when using composite keys. LookUpValue is pretty inefficient I agree
You can add a calculated column in Table 1 to LOOKUP the size from Table 2 using LOOKUPVALUE function
size =
LOOKUPVALUE (
Table2[Size],
Table2[UserID], Table1[User ID],
Table2[Variety], Table1[Variety]
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.