Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.