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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marry
Helper I
Helper I

How to make duplicated value to aggregate as one and merge the other column value?

Hello,

 

I have a table in specfic column (Site Code Merge Custom) contains the duplicated values, can someone advise how to create a new table that show like below? In column "Site Code Merge Custom" I only want the duplicated value show in one record, and the "Manufacturing Product Location Code" column value merge and use coma to separte out.

Thanks in advance.!

 

marry_0-1699272668205.png

 

1 ACCEPTED SOLUTION
marcelsmaglhaes
Super User
Super User

Hey @marry ,

 

You can combine the Row using Text.Combine function on Power Query.

 

First, you need to "group by whit sum" your table like the image bellow.

marcelsmaglhaes_0-1699276743694.png
Then, that will generate an error

marcelsmaglhaes_1-1699276792821.png

 

To fix the error, you need edit the M code like that:

Table.Group(#"Changed Type", {"Site Code"}, {{"Location Code.1", each Text.Combine([Location Code], ","), type nullable text}})

 

marcelsmaglhaes_2-1699276921943.png

 

You will achieve your lines combine!

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



View solution in original post

2 REPLIES 2
marcelsmaglhaes
Super User
Super User

Hey @marry ,

 

You can combine the Row using Text.Combine function on Power Query.

 

First, you need to "group by whit sum" your table like the image bellow.

marcelsmaglhaes_0-1699276743694.png
Then, that will generate an error

marcelsmaglhaes_1-1699276792821.png

 

To fix the error, you need edit the M code like that:

Table.Group(#"Changed Type", {"Site Code"}, {{"Location Code.1", each Text.Combine([Location Code], ","), type nullable text}})

 

marcelsmaglhaes_2-1699276921943.png

 

You will achieve your lines combine!

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



Hello @marcelsmaglhaes ,

 

Amazing!!!! Thank you so much!! It fully filfill my need. 🙂

Appreciated your help!

 

Best regards,

Mary Chen

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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