I'm working on converting an Excel process to a power query custom column, and the way it currently works is by referencing the cell above to write to current cell.
The Excel formula is =IF(G2<>"", IF(I2<>"",I2,""),H1) Which would be entered in H2 in this example. It essentially says when I have cells with values to the left, and the right of me, I will write the value of the cell to the right, until I see a cell on the left which isn't partnered up with a cell on the right, and go back to null. This runs through a few thousand rows and may be triggered a couple dozen times to patch tiny holes. The end result essentially looks like this, the center column is my new data (I'm using zeros instead of "" or null for visual sake):
- 0 0 0 - Write null
- 0 0 0 - Write null
- x 1 1 - Write value to the right
- 0 1 0 - Write value above
- 0 1 0 - Write value above
- x 0 0 - Write null
- 0 0 0 - Write null
Right now I have to write the formula before executing my query chain, I'd like to incorporate this step into a custom column, but I have yet to find a solution. I am a total newb to m code and power query, and stack overflow, but so far I have been able to execute each step I needed except for this one.