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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Dicken
Continued Contributor
Continued Contributor

Table Pivot, result explanation

Hi, 
if i have a table ; 

= #table( type table [ Name = text , Item = text ], 
 { {"Jon", "a"} , {"Jon", "a"} , {"Jon", "b"}, 
{ "Jon", "b"}, {"alan", "a"} ,{"alan", "a"}} )

and I want the 'items' as headers and then a concat of the values below, so grouped by name, i thought i could use; 

= Table.Pivot( Source, {"a","b"}, 
"Item", "Item", each Text.Combine(_,",") )

but this puts teh 'name' in the values ?   can some explaine why this happens,   I have found that if i dupilicate the item 
column then i can get the result i was looking for  ; 

= Table.Pivot( 
Table.AddColumn(  Source, "V",
each [Item] ), List.Distinct( Source [Item] ), 
"Item", "V" , each Text.Combine(_,",") )

so the problem seems to be caused when 'attribute and value are the same,  just wonderd if anyone had any insights as to 
why this happens ? 

Richard. 

1 REPLY 1
NattyM
Helper II
Helper II

Hi @Dicken , 

You are correct; in your first approach, you are missing the values, which is why the attributes are being concatenated instead of the values. In your second approach, you are assigning the values to the attributes, which is why it works as expected.

Please refer to the documentation for more information.
https://learn.microsoft.com/en-us/powerquery-m/table-pivot
Thanks

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.




https://learn.microsoft.com/en-us/powerquery-m/table-pivot

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.