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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
huguest
Advocate II
Advocate II

Remove replicated values in a grouped column

Hello,

I have some data on various invoices with a department and client column.  Some invoices can apply to either multiple clients or multiple departments.

Capture1.PNG

I use Group By a to concatenate the Client and Department values on a single row.

 

That works, except that I get combination of the same values for the respective fields.  

Capture2.PNG

How can I get only unique values for each column? 

i.e. for Invoice 1, I want Used; A,F and for Invoice 5 I want Used,Repair; E.

 

Thank you.

 

 

2 ACCEPTED SOLUTIONS
v-yuta-msft
Community Support
Community Support

@huguest ,

 

Try code below:

Result = Table.Group(#"Changed Type", {"Invoice"}, {{"Department Concatenated", each Text.Combine(List.Distinct([Department]), ","), type text}, {"Client Concatenated", each Text.Combine(List.Distinct([Client]), ","), type text}})

Capture.PNG  

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Mariusz
Community Champion
Community Champion

Hi @huguest

 

Just add List. Distinct before Text.Combine

= Table.Group(#"Changed Type", {"Invoice"}, {{"Department", each Text.Combine( List.Distinct([Department]), ", " ), type text}, {"Client", each Text.Combine( List.Distinct([Client]), ", "), type text}})

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @huguest

 

Just add List. Distinct before Text.Combine

= Table.Group(#"Changed Type", {"Invoice"}, {{"Department", each Text.Combine( List.Distinct([Department]), ", " ), type text}, {"Client", each Text.Combine( List.Distinct([Client]), ", "), type text}})

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

v-yuta-msft
Community Support
Community Support

@huguest ,

 

Try code below:

Result = Table.Group(#"Changed Type", {"Invoice"}, {{"Department Concatenated", each Text.Combine(List.Distinct([Department]), ","), type text}, {"Client Concatenated", each Text.Combine(List.Distinct([Client]), ","), type text}})

Capture.PNG  

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.