Forum Discussion

Pellegrino's avatar
Pellegrino
Frequent Visitor
5 years ago
Solved

Replacevalue with preceding row value if null

I have a column that is either null or has a value.

What I want is for 'm' to scan the entire column and replace null values with the preceding value.

 

My Code is this:

 

= Table.ReplaceValue(#"Added Custom3",each
[MyIndex],each if [MyIndex] = null then
(RawData1[MyIndex]{[Index]-1}) else [MyIndex],Replacer.ReplaceValue,{"MyIndex"} )

 

But it's not updating, and I don't know why. I'm assuming 'm' updates rows sequentially.

 

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    In the formula bar, type:

     

    = Table.FillDown(#"Added Custom3", {"MyIndex"})

     

    --Nate

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    In the formula bar, type:

     

    = Table.FillDown(#"Added Custom3", {"MyIndex"})

     

    --Nate