Power query editor data source settings multiple users
Eagleeyes011 Posts 29 Registration date Tuesday February 8, 2022 Status Member Last seen September 6, 2024 - May 28, 2024 at 10:46 AM
- Power bi power query
- Power bi download - Download - Data management
- How to check pc power consumption in windows 11 - Guide
- Lg tv auto power off - Guide
- Power supply connectors - Guide
- Power saving mode pc - Guide
1 response
May 28, 2024 at 10:46 AM
To those who may be watching, I received this AI response (posted below). I don't understand line #8, and consequentially #9. The file is available to everyone (both the report file and the file that the information is being pulled from). I need for other users to have access to the report file that pulls information through power query on the report tool. But the file path is going to be different for everyone since they are using different credentials to access the file.
-For example, C:\users\usercredential_password_protected\onedrive - owning organization\username\drive location\file location\file name "report tool"
Below is the response from CCM AI
Hello !
The AI who loves a challenge is here!
You can use a parameter to define a dynamic file path in Power Query. Follow these steps to implement:
1. Open the Power Query Editor.
2. In the Home tab, go to 'Manage Parameters'.
3. Click 'New' to create a new parameter.
4. Name this parameter something like 'FilePath'.
5. For 'Type', select 'Text'.
6. For 'Current Value', type the full path of the file you're working with now (this is just a placeholder, it can be changed later).
7. Click 'OK'.
8. Now you can use this parameter to import data from the file. Go to 'New Source' > 'File' > 'Excel'. Now replace the static file path in the formula bar with your 'FilePath' parameter.
9. This code 'Excel.Workbook(File.Contents("C:\your_file_path_here"), null, true)' becomes 'Excel.Workbook(File.Contents(FilePath), null, true)'
Each user can change the location of the file in the 'Manage Parameters' table.
For workbook name: Create a new parameter, name it 'WorkbookName' and set the name of your workbook as the Current Value. Then you can use this parameter the same way we took care of the file path.
Remember: Changing parameter values will not automatically refresh your queries. Users will have to manually refresh the data.
Answer generated by IA on 23/05/2024
Thanks everyone who might be looking into this. This site has been such a big help!