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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
theapengelly
Frequent Visitor

Concatenate one column and group by multiple

Hey, 

 

I am trying to reduce the number of rows in my table, by concatenating distinct values in a particular column, but I want to leave all other columns the same.

 

How would I go from this

ItemClientLabel
2442431A
2442431B
2442432A
2442432B
2442433A
2442433B
2442434A
2442434B
1762225B
1762226B

 

To this:

ItemClientLabel
2442431A,B
2442432A,B
2442433A,B
2442434A,B
1762225B
1762226B

 

So I just want to concatenate the unique values in the Label column, and group by Item and Client?

 

Thanks so much!

1 ACCEPTED SOLUTION
Smalfly
Responsive Resident
Responsive Resident

@theapengelly ,

 

try this:

 

Table.Group(Source, {"Item", "Client"}, {{"concat", each Text.Combine([Label], ", "), type text}})

View solution in original post

3 REPLIES 3
theapengelly
Frequent Visitor

Thank you this worked!

DataNinja777
Super User
Super User

Hi @theapengelly ,

You can produce your required output by writing a ConcatenateX measure like below:

ConcatenateX Label = concatenatex(distinct('Table'[Client Label]),'Table'[Client Label],", ")

The required output is as shown below:

DataNinja777_0-1726240151171.png

Best regards,

 

Smalfly
Responsive Resident
Responsive Resident

@theapengelly ,

 

try this:

 

Table.Group(Source, {"Item", "Client"}, {{"concat", each Text.Combine([Label], ", "), type text}})

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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