I have a Power Query where I need to reference two different Sample Files depending on a variable:
For the line:
I'd like to replace "Transform File (3)" with a variable, this works for the first instance but not the second, for example:
Can someone provide any guidance on what I should be using?
VBA Code:
let
SourceType = Excel.CurrentWorkbook(){[Name="SourceType"]}[Content]{0}[Column1],
SourceLocation = if SourceType = "Fileshare" then "C:\Fileshare" else "C:\Egnyte",
Source = Folder.Files(SourceLocation),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File (3)", each #"Transform File (3)"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File (3)"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File (3)", Table.ColumnNames(#"Transform File (3)"(#"Sample File (3)")))
in
#"Expanded Table Column1"
For the line:
Code:
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File (3)", each #"Transform File (3)"([Content])),
I'd like to replace "Transform File (3)" with a variable, this works for the first instance but not the second, for example:
Code:
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", VARIABLE, each #VARIABLE([Content])),
Can someone provide any guidance on what I should be using?