Forum Discussion

davi's avatar
davi
Frequent Visitor
3 years ago
Solved

Replace null values from multiple columns with values from other columns in place

I have a table with a level structure with some null values on upper levels and I wanted to replace those empty records with the value from the first previous level that is not null. Conceptually I t...
  • AlienSx's avatar
    3 years ago

    Hi, davi 

    use Table.TransformRows instead. It will give you list of records in the end but you can wrap the whole step with Table.FromRows to get your table back. 

  • davi's avatar
    davi
    3 years ago

    Thanks AlienSx ! I had to create one step per level like bellow and it worked:

    Table.FromRecords(Table.TransformRows(#PreviousStep,
    (r) => Record.TransformFields(r,
    {{"A1", each if _ = null then r[#"A"] else _},
    {"B1", each if _ = null then r[#"B"] else _}})))