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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Einomi
Helper V
Helper V

Proper Format Records to columns

Hello,

 

I would need to go from this format

 

Capture d’écran 2023-01-15 à 2.48.39 PM.png

 

to this 

 

Capture d’écran 2023-01-15 à 2.48.48 PM.png

 

in POWER QUERY

 

I have done some steps but the farest I went, is to have the first three columns with Surname, Father Name, Mother Name and the fourth column is the table of all the children belonging to the parents, but I am not sure how to format it as shown above

 

Thanks

 

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Community Champion
Community Champion

NewStep=#table(List.FirstN(Table.ColumnNames(PreviousStepName),3)&{"CHILD NAME","DOB","YEAR"},List.TransformMany(Table.ToRows(PreviousStepName),each List.Split(List.Skip(_,3),3),(x,y)=>List.FirstN(x,3)&y))

View solution in original post

3 REPLIES 3
wdx223_Daniel
Community Champion
Community Champion

NewStep=#table(List.FirstN(Table.ColumnNames(PreviousStepName),3)&{"CHILD NAME","DOB","YEAR"},List.TransformMany(Table.ToRows(PreviousStepName),each List.Split(List.Skip(_,3),3),(x,y)=>List.FirstN(x,3)&y))

Hi @wdx223_Daniel 

 

Many thanks, seems to work, has to do further tests but we are definitely on the right way.

 

I am bit confused with the # at the beginning NewStep = #table, what this # refers to please ?

Hi  @Einomi 

 

# is not an independent character here. #table should be used together to create a table. Please refer to #table - PowerQuery M

vjingzhang_0-1673938488820.png

Best Regards,
Community Support Team _ Jing

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

Top Solution Authors