Forum Discussion

Charlie1234's avatar
Charlie1234
New Member
3 years ago
Solved

Look up multiple values from one cell

Hi,   I have a column in one of my data sources that holds staff ID numbers, but I need it to show as the staff members name.   I've used a lookup value against another table, but the trouble I a...
  • v-yueyunzh-msft's avatar
    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