Forum Discussion
How can I collapse multiple rows to single with last row as concatenated
- 1 year ago
Hi EaglesTony
I'd recommend leveraging UI as much as you can and only coding wherever not possible with UI. For this You can use UI to Group by first 3 Columns and have UI generate the M code, then with some modification on the code to concatenate the Names.
The UI will generate M code below
= Table.Group(Source, {"Area", "Domain", "Sub-Domain"}, {{"teamMembers", each _, type table [Area=text, Domain=text, #"Sub-Domain"=text, TeamMember=text]}})then Replace the part
{{"teamMembers", each _, type table [Area=text, Domain=text, #"Sub-Domain"=text, TeamMember=text]}}with below M code to concatenate those names.
{{"TeamMembers", each Text.Combine([TeamMember], " / "), type text}}Hope this helps:)
Thank you, ToddChitt , MasonMA , and Omid_Motamedise , for your responses.
Hi EaglesTony,
We appreciate your inquiry raised through the Microsoft Fabric Community Forum.
We would like to follow up to know if you have had the opportunity to review the solutions provided by MasonMA, Omid_Motamedise to address the issue. We hope that the information shared will assist in resolving your query.
Should you have any further questions or require additional assistance, please do not hesitate to reach out to the Microsoft Fabric Community.
Thank you.