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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ivanuska
Advocate I
Advocate I

Merging data in one column as per unique column in same table

Hi guys,

 

I am new to Power BI and would need your help. I've got the example of dataset and would need to merge the lines in "Country" column as per unique values and concatenate inputs in "City" column separated by comma - perhaps using Measure (as Calculated column would create duplicate entries). Please find below details:

 

Existing dataset:

ivanuska_0-1613486890301.png

 

Result should be:

     

CountryCity
FranceParis
USANew York, Chicago, Minesota
GermanyBerlin
ItalyRome

     

Thank you for any suggestion!

 

 

1 ACCEPTED SOLUTION

I have managed to resolve this by adding ", " at the end of your function:

 

New table = summarize('Table', 'Table'[Country], "City",concatenatex('Table', 'Table'[City], ", "))
 
ivanuska_0-1613495946084.png

 

 
Thank you for help!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ivanuska , You can use this measure in the display table

concatenatex(Table, Table[City])

 

New table = summarize(Table, Table[Country], "City",concatenatex(Table, Table[City]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have managed to resolve this by adding ", " at the end of your function:

 

New table = summarize('Table', 'Table'[Country], "City",concatenatex('Table', 'Table'[City], ", "))
 
ivanuska_0-1613495946084.png

 

 
Thank you for help!

Now it is merging without comma e.g. "New YorkChicagoMinesota" - can you please advise how to separate those values with comma?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.