Forum Discussion
relative file reference
- 10 years ago
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)
sshweky You can use newly introduced parameters functionality to dynamically switch data sources.
Do you have an example or soemthing I can read? I am not familiar with this?
- sshweky10 years agoHelper 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!!
- Anonymous10 years agoNot applicable
So many questions on Power Query and M... so many things to learn. In the meantime, it's nice to know people like ImkeF. Maybe she can help out with this.
- ImkeF10 years agoCommunity Champion
let me shortly explain the error-message:
Ipath is a list, so you would have to decide somewhere, which item from the list should be taken. Also that is the reason why you cannot use Text.Combine on it, because you can use this command only with text as input, not with lists.
If you're working in Excel, you can try my dynamic approach instead:
So after you've extracted the individual dynamic filepath in a query named "Filepath" (which should be a table with one row only) you can construct your dynamic filepath like this:
lfile = Text.Combine({Filpath[TheColumnNameWithPathInIt]{0}, "\FC\dashboard\fc.mdb"}, ""),So the key is to adress the content of the table like in Excel via 2 coordinates: Columnname (here. "TheColumnNameWithFilepathInIt") and the rownumber (here: 0, as PQ starts to count with zero).
I find this article very helpful on this matter.