Forum Discussion

sshweky's avatar
sshweky
Helper III
10 years ago
Solved

relative file reference

Hi - I am trying to pull data from a dropbox file in Power Query. However, every user has a different path to that dropbox file. Any ideas on how to use dynamic file references in the advanced query editor?

 

A couple more questions...

 

(1) Is there a function I can use to return the name of the current directory?

(2) Is there a funnction I can use to go up or down one level in the directory structure?

 

Thank you!!!

 

Steven

  • Hm, strange.

    Please try another split on _invdtl 

     

    Otherwise please try if the other option works (just to check if there isn't anything else to it here, or a bug)

12 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    sshweky You can use newly introduced parameters functionality to dynamically switch data sources. 

    • sshweky's avatar
      sshweky
      Helper III

      Do you have an example or soemthing I can read? I am not familiar with this?

      • sshweky's avatar
        sshweky
        Helper III

        I am working in Excel 2016 with Power Query (not PowerBI). Here is a little bit more detail of the way I am doing it ...

         

        So far I have an excel file with a table called "MyPath" which stores each user's path. The value in my "MyPath" is "C:\Users\Steven\Desktop\Dropbox". How do I retrieve that path, combine it with the file name "\dashboard\fc.mdb" and use that entire file name to build a query in my main template file?

         

        I tried to build a query (called PathQuery) to retrieve the path from "MyPath.xlsx" & then combine the path & the file name, but I get an error that I can't combine a Type List with a Type Text.

         

        lpath= PathQuery[MyPath],
        lfile = Text.Combine({lpath, "\FC\dashboard\fc.mdb"}, ""),
        Source = Access.Database(lfile),

         

        Thank so much for your help!!