1
votes

I have a table that has some columns that are the result of a [power] query which has the key fields, some columns that are intended for manual data entry and some that are formula columns.

My problem is that when I refresh the query columns the manual input data associated with specific query rows don't remain on the same row.

To overcome this I use a query that first extracts the manual input data in the existing table together with the key fields, perform the new query and then do a table join at the end of the query to get the input data back in the correct record. (any input on alternative solutions welcome...)

For tables with no formula columns I could identify the manual input fields automatically using:

List.Difference(Table.ColumnNames(Current_Source_Table), Table.ColumnNames(Pre-Join_Query_Result)).

However, this would also pick up the calculated columns with excel formulas in. How to a distinguish these formula columns to exclude them? Preferably without having a naming convention that allows identification.

Many thanks,

Joe

1

1 Answers

1
votes

Excel.CurrentWorkbook does not have information on where columns get their values from, so outside of naming conventions or other potential tricks I don't know, it is not possible to distinguish them.