Forum Discussion

Matski469's avatar
Matski469
Frequent Visitor
2 years ago
Solved

How to expand record without mostly null values

Within Power Query, using the desktop, I expand a column of records into multiple columns.  No issue there, except that the values I get are sort of stair-stepped with mostly null values around them ...
  • spinfuzer's avatar
    spinfuzer
    2 years ago

    Maybe try

     

    Table.TransformColumns(Source, {"parameters", Record.Combine})

     

    On the step when parameters is still a list.  This will provide cleaner expansion if each record does not have fields with null values.  I am hoping the nulls just come because you have a bunch of different records with different field names and when expanding the records at the same time you get nulls because the fields don't exist in other records.  When you click on an invidual cell you can see what the record looks like below.

     

    If records that are being combined have the same field, it will be overwritten by the latest value.

    Combining [A = 1]  with [A = null, B = 2] will give you [A = null, B = 2].

    Combining [A = 1] with [B = 2] will give you [A = 1, B = 2].