I'm a beginner to Power Query and it seems that some of the syntax has changed so have been trying to look this one up for a while and still no further forward. I need to reference the previous row of data, but it needs to be the same column, not a new one.
I'm pulling out employee data and the employee number is only indicated once every 100 lines or so. I have a column to pull the data out and it displays the employee number. I need to repeat that employee number for every line until there is a new employee number. I've created an index field. The previous step name is Employee and the column it creates is [Employee]. Adding a new custom column called [EmpNo] and adding the following just results in errors against every field but the ones matching the [Employee] column indicating it doesn't like #"Employee"{[Index]-1}[EmpNo]
if [Employee] = "" then #"Employee"{[Index]-1}[EmpNo] else [Employee]
Anyone any ideas what I'm doing wrong? If left cell = "" then use above cell else use left cell.