Forum Discussion

Greenbrr's avatar
Greenbrr
New Member
6 years ago

Column disappears after adding custom columns

Hi there,

 

I'm fairly new to Power Query, but have been learning lots with the help of a coworker who is a power user, so forgive me if this is a dumb question.  I am currently building some files that have a circular reference to each other:

 

User 1 enters data in File 1

File 1 feeds File 2.  User 2 enters data in blank cells in File 2.

File 2 feeds back to File 1 (via table lookups).

 

"File 2" is referencing a snapshot of the table in File 2 so that any data entries User 2 made to the file are preserved when the document is refreshed.  Here is a quick summary of the process:

 -load snapshot of table to query,

 -merge back to original table

 -add in custom columns with "if" statements

 -delete original and merged "snapshot" columns

 -rename custom columns to original column names

 -reorder columns so that the output matches the original table layout. 

 

I have used this structure before without issue, but am now having a problem where an unrelated column is disappearing after I add my last custom column.  The error is telling me that the missing column was not found on the "snapshot" file, but I'm puzzled by this for two reasons:

 

1) when I check the snapshot the column is there

2) this column was not one that was included when I expanded columns after merging, so why does it even matter?

 

Im totally stumped.  Any help is greatly appreciated!

2 Replies

  • dax's avatar
    dax
    Community Support

    Hi Greenbrr , 

    I am not sure which step cause this problem, so if possible could you please inform me more detailed information(such as your M code and your sample data (by OneDrive for Business), you could use virtual data instead of real data)? Then I will help you more correctly.

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • edhans's avatar
    edhans
    Community Champion

    Force a full refresh in Power Query, or even clear the PQ cache in the File|Options menu. It may be remembering a previous version of the file without that column.