Forum Discussion

lmk001's avatar
lmk001
Copper Contributor
Jul 15, 2020
Solved

Power Query File Name Drop Down

I'm going to do my best to describe this.  I would like to create a parameter query where the user selects a filename and the table will display based on what the user selects from the drop down.  I ...
  • SergeiBaklan's avatar
    Jul 15, 2020

    lmk001 

    If file and table names are the same you may add named cell, let say fileTableName, in your workbook with it's name, after that it's like

    let
        getFileTableName = Excel.CurrentWorkbook(){[Name="fileTableName"]}[Content]{0}[Column1],
        Source = Excel.Workbook(File.Contents("C:\Test\" & getFileTableName & ".xlsx"), null, true),
        Table1_Table = Source{[Item=getFileTableName,Kind="Table"]}[Data]
    in
        Table1_Table

    just change the folder name as necessary. With drop-down list it's the same, named cell will be one with drop-down list.