Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.