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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Einomi
Resolver II
Resolver II

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
Super User
Super User

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
Super User
Super User

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors