Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I seeking advice on how to combine or consilidate similar columns from records.
For example a queury will have columns "name", "id", "level", "Children"
the column "Children" will be a list of records with same named columns, so once extracted it duplicates the exisiting rows and creates new columns for the added rows "name.1", "id.1", "level.1", "Children.1"
Is there a way so that the extracted values will go to the existing columns and just create new rows for the new data?
Example-
list:
Expanded List:
Expanded Record:
What I'm trying to accomplish is for the expaned records to combine instead of creating new columns. Any help is appreciated and thank you in advance.
you can try this recurrsive function
=let fx=(tbl)=>let a=Table.RemoveColumns(tbl,"Children",MissingField.Ignore),b=List.RemoveNulls(tbl[Children]? ??{}) in if b={} then a else a&@fx(Table.FromRecords(List.Combine(b))) in fx(YourTableName)
@wdx223_Daniel
Thank you for your suggestion but I apologize as I'm not sure how to fit that into the m code exactly. This screenshot is the error and code. How exactly do I fit this function to this?
try to delete these two step
and replace the step of "test" with this
test=let fx=(tbl)=>let a=Table.RemoveColumns(tbl,"Children",MissingField.Ignore),b=List.RemoveNulls(tbl[Children]? ??{}) in if b={} then a else a&@fx(Table.FromRecords(List.Combine(b))) in fx(#"Expanded Info")