Search code examples
excelpowerquerym

dynamic source file paths in excel


Here is an example of my problem :

here is the worksheet n°1

Worksheet n°1

here is the worksheet n°2 enter image description here

I would like to provide the path of a source file and that the informations are deduced from the first worksheet and displayed in the table of the second worksheet.

[EDIT]

Here is the query related to the cell "total of people". I still don't know how to fetch the information from another file

enter image description here


Solution

  • This tutorial is probably a solution to my issue :
    https://exceloffthegrid.com/power-query-source-cell-value/

    The exemple file work well but for some reasons I can't use another file with this technique ...

    this following line (tblSourceData is the table name of the exemple) :

    Source{[Item="tblSourceData",Kind="Table"]}[Data]

    need to be different (Table1 is the table name of my new file) :

    Source{[Item="Table1",Kind="Table"]}[Data]

    here is the proof of the table name of my new file : enter image description here

    But I get this error when I edit the name : enter image description here

    (I have obviously correctly changed the path to the source file in my cells for this exemple)

    [LAST EDIT]

    The solution was to don't forget to creat a real Table in the source file with the name "Table1".