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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Grouping or Transpose table

Hi folks,

 

Hope you are well. I am trying to group and transpose data as below. Can you let me know if there is a way to acheive this?

 

Actual table:

 

CustomerItem Bought
AAACar
AAABike
AAACycle
BBBCar
CCCCar
CCCBike

 

Desired Output:

CustomerItem Bought
AAACar,Bike,Cycle
BBBCar
CCCCar,Bike

 

Thanks for your time and help.

1 ACCEPTED SOLUTION
ddpl
Solution Sage
Solution Sage

@Anonymous Create below Measure

 

Measure = CONCATENATEX('Table','Table'[Item Bought],",")

 

or 

 

Another way in power query

 

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

 

View solution in original post

2 REPLIES 2
ddpl
Solution Sage
Solution Sage

@Anonymous Create below Measure

 

Measure = CONCATENATEX('Table','Table'[Item Bought],",")

 

or 

 

Another way in power query

 

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

 

Anonymous
Not applicable

Hi @ddpl Thank you so much for your response, much appreciated

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.