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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
CameronJohnson
Regular Visitor

Concatinate all results from a Lookupvalue()

I have two tables, Tasks and Assignments (examples given below). Each task can have multiple (or no) assignees associated with it.

 

Tasks

id, title

1, "Do stuff"

2, "Do other stuff"

3, "Do something else"

 

Assignments

taskID, Name

1, "Bob"

2, "Joe"

2, "Bob"

 

Basically, I want to be able to add a new column to Tasks that will concatenate together the list on names from the records on the Assignments table who's taskID matches the id of the Task using a comma as the delimiter. I'd like to end up with something like this:

 

id, title, assignees

1, Do stuff, "Bob"

2, Do other stuff, "Joe, Bob"

3, Do something else

 

Now, if there weren't multiple results for each one, I would use the following DAX:

Assignee = LOOKUPVALUE(Assignments[Name],Assignments[taskID],Tasks[id])

 

However, that function doesn't work with multiple results (and I'd still need to have a way to concatinate the resulting list).

 

Any ideas on how I can achieve this?

1 ACCEPTED SOLUTION

It wasn't exactly what I was asking, but that did show how to get the first result, which put me on the right track.

 

Here's what I did to get it to work:

Assignee = CONCATENATEX(FILTER(ALL(Assignments), Assignments[id] = Tasks[taskID]), Assignments[Name],", ")

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @CameronJohnson ,

 

Looks like this post has a solution you ar lookign for for the lookup value error

https://community.powerbi.com/t5/Desktop/LOOKUPVALUE-quot-A-table-of-multiple-values-was-supplied-wh...

 

Thanks,

Tejaswi

It wasn't exactly what I was asking, but that did show how to get the first result, which put me on the right track.

 

Here's what I did to get it to work:

Assignee = CONCATENATEX(FILTER(ALL(Assignments), Assignments[id] = Tasks[taskID]), Assignments[Name],", ")

Thank you so much for posting the solution!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.