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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Concatenate distinct rows one to many

I am trying to perform concatenate on a one to many relationship and I want to have no duplicate values. 

 

 

CONCATENATEX(
    FILTER('Table',[Site] = EARLIER([Site]) && [User] IN { "a", "b", "d" }),
    [User],,""
  )

 

 

I tried this and I end up with values like this:

id

userwanted
1aaabd
1aaabd
1baabd
1daabd
1c 
2aab
2bab
2c 
3aad
3dad
4c 

 

Here is a table representing what I would like.

 

id

userwanted
1aabd
1aabd
1babd
1dabd
1c 
2aab
2bab
2c 
3aad
3dad
4c 
5 REPLIES 5
parry2k
Super User
Super User

@Anonymous try this measure

 

C = 
CONCATENATEX (
    CALCULATETABLE ( VALUES ( con[user] ), FILTER ( ALLEXCEPT ( con, con[id] ), con[User] IN { "a", "b", "d" }) ),
    [user], ","
)

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



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.

Anonymous
Not applicable

I like this so much!  It gets closer than ever.  However, now I am finding the concatenated results are being considered distinct based on their order rather than their content.  How would I go about resolving this level of distinction?

iduserwantedresult

1

a

abdabd
1babdabd
1dabdabd
1dabdabd
1c  
2a  
2dabdadb
2babdadb
3c  

 

@Anonymous I'm lost, what is missing between wanted and result?



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.

Anonymous
Not applicable

ID 1:

wanted

abc

result

abc

 

ID 2:

wanted

abc

result

acb

 

This level of distinction recognizes a, b, and c are all unique and different.  However the resulting calculation does not recognize abc and acb as the same. 

@Anonymous I think it will be easier to sort the table in Power Query by user and it will fix itself.



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.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.