Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I am importing an access database. My current M code is the following:
let
Source = Access.Database(File.Contents("C:\Users\John\Company Finance Dropbox\Accounting and Finance\Access Databases\Daily Sales Snapshot v6.0.accdb"), [CreateNavigationProperties=true]),
The problem is when another person tries to use this file, the references break because of the hard coded file Reference to "John". Everything else will be the exact same. I have read 25+ articles on how to make this a reference and figured it out yesterday but can't remember which of the million options I tried made it work.
I'd like instead of "John" to be the current username of whoever is working on the report. It may be Jack, Jill, etc. but everything else will be the same. I can't remember how to pull the current file path. There was a query I wrote (maybe it was a function) that gave me that filepath, and then I could replace the hardcoded part of the filepath with a reference to that query.
Thanks for your help!
Solved! Go to Solution.
@jgsudderth ok, check this post to get the user name, which you can use to replace the user from the path:
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@jgsudderth ok, check this post to get the user name, which you can use to replace the user from the path:
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@jgsudderth maybe create a parameter with the name value and replace the name with the parameter, so anytime the parameter value is changed, it will update the path.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The problem is I don't know if it will be Jack, Jill, Jack 2, etc. I'd like to future-proof this as much as possible so pulling the current user via a file path function and then inserting that would allow me to not know EVERY username that could ever use the file. Unfortunately laptops and desktops all create new "usernames" as part of that dropbox file reference.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
124 | |
114 | |
74 | |
65 | |
46 |