Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I would like to use %USERNAME% or %USERPROFILE% in the Data source settings, such as the image below. This way, users can put the source files in their own Documents folder no matter who they are.
It seems to accept it when I entered that and clicked OK, but when I click "Apply Changes" it reports the error "File or folder: Could not find a part of the path."
----------
I also tried %USERPROFILE% to eliminate the need for "C:\Users\"
... but that time, all I did was enter it and click OK, and it immediately reported: "We didn't find any data sources in this file."
Any ideas? Thank you.
Solved! Go to Solution.
Hello, @WillBeeSEA ,
Power Query cannot access environment variables. And there is no built in function to do so either. Perhaps with python inside Power Query, you can do that.
However, why do you actually want to even do this? As this is very bad design. Why can't you put the file on shared place like a sharepoint folder or, if you really need this, perhaps create folder in C:\ directly, so everyone can have the same path.
In general using local path to access files is not the best idea + you can't really easily refresh it on PBI Service either.
Hello, @WillBeeSEA ,
Power Query cannot access environment variables. And there is no built in function to do so either. Perhaps with python inside Power Query, you can do that.
However, why do you actually want to even do this? As this is very bad design. Why can't you put the file on shared place like a sharepoint folder or, if you really need this, perhaps create folder in C:\ directly, so everyone can have the same path.
In general using local path to access files is not the best idea + you can't really easily refresh it on PBI Service either.
Hi vojtechsima,
Thank you for the information about the PQE not being able to access environment variables. and yes, it is not the best approach. I like your other options better.
Will