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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Pivot row into column for each new occurrence

Hi

I have no problem with regular pivot column operation but is it easily possible to create a new column for each occurence of a value in a column?

 

Thanks

 

PBM

 

Sample data

id,name,contact

1,john,Mr Johnny

1,john,Mrs Johnny

2,fred,Mr Fred

3,jane,Mr Jane

3,jane,Mrs Jane

3,jane,Aunty Jane

 

Desired Output

id,name,contact1,contact2,contact3

1,john,Mr Johnny,Mrs Johnny,null

2,fred,Mr Fred,null,null

3,jane,MrJane,Mrs Jane,Aunty Jane

 

1 ACCEPTED SOLUTION
KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

You can use Group-by to group text.

 

1. Group-by id, name and count the row. then update the code to something like

Table.Group(#"Promoted Headers", {"id", "name"}, {{"contact", each Text.Combine([contact],",")}})

 

2. split the contact column by delimiter

 

KT_Bsmart2gethe_0-1657500000143.png

 

Regards

KT

 

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

NewStep=Table.Combine(SampleData,"id",{"n",each #table({"id","name"}&List.Transform(List.Positions([contact]),each Number.ToText(_+1,"contact0")),{[contact]})})[n])

KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

You can use Group-by to group text.

 

1. Group-by id, name and count the row. then update the code to something like

Table.Group(#"Promoted Headers", {"id", "name"}, {{"contact", each Text.Combine([contact],",")}})

 

2. split the contact column by delimiter

 

KT_Bsmart2gethe_0-1657500000143.png

 

Regards

KT

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors