Forum Discussion
Look up multiple values from one cell
- 3 years ago
Hi , Charlie1234
According to your description, you want to lookup value from one table by ids , and in a row , you have multiple ids.
For your need , here are the steps you can refer to :
(1)This is my test data:(2)We can click "New Column" and enter this:
Column = VAR Items1 = SUBSTITUTE ( [IDs], ",", "|" ) VAR T1 = GENERATESERIES ( 1, COALESCE ( PATHLENGTH ( Items1 ), 1 ), 1 ) VAR T2 = SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items1, [Value] ) ) var T3 = ADDCOLUMNS(T2, "name" , LOOKUPVALUE('Name'[FirstName],'Name'[ID],VALUE([@Item])) & LOOKUPVALUE('Name'[LastName],'Name'[ID],VALUE([@Item]))) return CONCATENATEX(T3, [name] , ",")Then wen can get this:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , Charlie1234
According to your description, you want to lookup value from one table by ids , and in a row , you have multiple ids.
For your need , here are the steps you can refer to :
(1)This is my test data:
(2)We can click "New Column" and enter this:
Column = VAR Items1 = SUBSTITUTE ( [IDs], ",", "|" )
VAR T1 = GENERATESERIES ( 1, COALESCE ( PATHLENGTH ( Items1 ), 1 ), 1 )
VAR T2 = SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items1, [Value] ) )
var T3 = ADDCOLUMNS(T2, "name" , LOOKUPVALUE('Name'[FirstName],'Name'[ID],VALUE([@Item])) & LOOKUPVALUE('Name'[LastName],'Name'[ID],VALUE([@Item])))
return
CONCATENATEX(T3, [name] , ",")
Then wen can get this:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Charlie12343 years agoNew Member
Thank you this is exactly what I was looking for!