Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
jcastr02
Post Prodigy
Post Prodigy

Look up value and combine into one cell

Hello I have two tables.  I am trying to get information into Table 2 - Line of  Business Look up.  As you see EID in TAble 1 has EID 1493615 has two values (Pharmacy and Data Entry) , I'd like both of those values to go into a cell as shown in Table 2 under hte Line of business Lookup column.   SEeing if there is a calculated column that could be added for it to show like below in table 2.

 

TABLE 1  TABLE 2 
EIDLine of Business EIDLine of Business Lookup
1493615Pharmacy 1493615Pharmacy; Data Entry
4171065Pharmacy 4171065Pharmacy
4203520Pharmacy 4203520Pharmacy
1498994Pharmacy 1498994Pharmacy
2262366Pharmacy 2262366Pharmacy
2665329Pharmacy   
4031705Pharmacy   
4032981Pharmacy   
4050301Pharmacy   
4051236Pharmacy   
1493615Data Entry   

 

1 ACCEPTED SOLUTION

Apologies again. This is what happens when you are trying to solve more complex DAX from your phone so I must stop doing it!!
Ok, I have now been able to test this:
For a calculated column:

 

Line of Business =
VAR _Table =
    CALCULATETABLE (
        VALUES ( 'Table 1'[Line of Business] ),
        FILTER ( 'Table 1', 'Table 2'[EID] =  'Table 1'[EID]  )
    )
RETURN
    CONCATENATEX ( _Table, 'Table 1'[Line of Business], "; " )

 

Column.JPGAs a measure:

 

Line of Business =
VAR _Table =
    CALCULATETABLE (
        VALUES ( 'Table 1'[Line of Business] ),
        'Table 2'[EID] IN VALUES ( 'Table 1'[EID] )
    )
RETURN
    CONCATENATEX ( _Table, 'Table 1'[Line of Business], "; " )

 

Measure.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

Try:

Line of Business =
COCATENATEX(

   TREATAS(VALUES(Table 2 [EID]), Table 1 [EID]),

Table 1 [EID], "; ")





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks @PaulDBrown   It seems I am doing something wrong?

 

Screenshot 2021-11-05 144628.png

You need to close the TREATAS brackets after the first  'Cross trained' [EID]





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown Thank you.  Right now it's pulling over EIDs  I'm trying to get it to pull Line of Business when the EID matches (like in second column of table 2)

Apologies. My mistake. Try:

Line of Business =
COCATENATEX(

   TREATAS(VALUES(Table 2 [EID]), Table 1 [EID]),

Table 1 [Line of business], "; ")





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown  Thanks ...it looks like when I try to type from table 1, the only option that comes up is the EID, it won't let me pull Line of Business overScreenshot 2021-11-05 144628.png

Apologies again. This is what happens when you are trying to solve more complex DAX from your phone so I must stop doing it!!
Ok, I have now been able to test this:
For a calculated column:

 

Line of Business =
VAR _Table =
    CALCULATETABLE (
        VALUES ( 'Table 1'[Line of Business] ),
        FILTER ( 'Table 1', 'Table 2'[EID] =  'Table 1'[EID]  )
    )
RETURN
    CONCATENATEX ( _Table, 'Table 1'[Line of Business], "; " )

 

Column.JPGAs a measure:

 

Line of Business =
VAR _Table =
    CALCULATETABLE (
        VALUES ( 'Table 1'[Line of Business] ),
        'Table 2'[EID] IN VALUES ( 'Table 1'[EID] )
    )
RETURN
    CONCATENATEX ( _Table, 'Table 1'[Line of Business], "; " )

 

Measure.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown Yes!!! that worked, you are awesome thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors