0
votes

Lets say that I have a table in Power Query where the number of columns is not fixed (it varies depending on the data that I get from database).

The issue is that I want to fill down values later on, for which I have a code like

Table.FillDown(#"Razvrščene vrstice",{"Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10"})

Of course when I get lets say one column less, the whole thing crashes ('Cannot find column Column10')...

Is there any way around this? For example: 'choose all but the first two columns and fill them down'?

Thanks, Matija

1

1 Answers

0
votes

Does this help?

If I start with this table, named Table1:

enter image description here

And I use the following query:

let
Source = Table1,
#"Filled Down" = Table.FillDown(Source,List.RemoveMatchingItems(Table.ColumnNames(Source),{"Column1", "Column2"}))
in
#"Filled Down"

I get this:

enter image description here

The {"Column1", "Column2"} are the names of the columns to be skipped during the filldown.