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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Joshua_P
New Member

Data manipulation/translation/power query help

Hello, I have a list of pricing/sales for customers. The way it's sorted I'm pulling off the the SKU and I want to pull in a dataset that has the SKU and the customer names but concatonated instead of separated.

 

The closest I've been is to just put it in a povit and individually used a =textjoin but that's not sustainable. Here's an example of the dataset and result I'm trying to get from data formatted like this but with a lot more SKUs.

 

I would like pbi to do this for me 

 

SKUCustomer
1234Facebook
1234Amazon
1234Apple
1234Netflix
1234Google
  
Output 
1234Facebook, Amazon, Apple, Netflix, Google
7 REPLIES 7
Anonymous
Not applicable

Hi  @Joshua_P ,

 

Here are the steps you can follow:

1. Create calculcated table.

Table 2 =
SUMMARIZE(
    'Table',
    'Table'[SKU],
    "Customer",CONCATENATEX(FILTER('Table','Table'[SKU]='Table'[SKU]),'Table'[Customer],","))

2. Result.

v-yangliu-msft_0-1605691563127.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Ashish_Mathur
Super User
Super User

Hi,

 

Show a more relevant example with more SKU's and Customers and on that larger dataset, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PhilipTreacy
Super User
Super User

Hi @Joshua_P 

This code produces the result you specified - download the sample PBIX file

group-sku.png

But by the sounds of your latest message your data isn't quite arranged as laid out in your initial post.

If this code isn't workign for you please post a real example of your data structure, the actual data can be modified/anonymized, but the column names and order are important.

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


amitchandak
Super User
Super User

@Joshua_P , Try concatenatex

concatenatex(Table,table[Customer])

 

Also refer: https://www.youtube.com/watch?v=du2HSEzng2E

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

Thank you for taking the time to respond. Unfortunatley this doesn't seem to be working, I've tried testing a few variations. Maybe I'm doing it wrong.

I have multiple SKUs and multiple company names to go with them and when I use this formula it's mostly just taking all of the customer names and not just the ones that share a SKU.

OwenAuger
Super User
Super User

Hi @Joshua_P 

You can Table.Group with Text.Combine to group by SKU and concatenate the Customer values.

Here is a sample query, with the "Grouped Rows" step being the key step:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUXJLTE5Nys/PVorVgYs55iZW5eehiBQU5KQiC/illqTlZFYgC7nn56eDFMUCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [SKU = _t, Customer = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"SKU", type text}, {"Customer", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"SKU"}, {{"Customers", each Text.Combine([Customer],", "), type text}})
in
    #"Grouped Rows"

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hello! Thank you so much for putting this together. Unfortunately I can't seem to get it to work.

 

I'm pretty new with the coding pat of it like this so I tried to replace the correct variables and it sell doesn't seem to be working.

 

The SKU, and the Customer Name are on the same page along with some other data separated by SKU with the SKU being the really only duplicated value in the sheet other than the company names as well.

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.