Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I would like to give a powerBI to someone else to use that does not have access to my folder.
I maintain a couple excel files that create input parameters for the subsequent table imports.
I would like to modify the import code of this excell file to be relative to the current folder the pbix file is in.
How do I do that?
ie
Convert
Source = Excel.Workbook(File.Contents("C:\Subfolder\Example\SitURLs.xlsx"), null, true),
to
PV_Folder=MAGICPOWERQueryFunctionforcurrentpath()
Source = Excel.Workbook(File.Contents(""& PV_Folder &"\SitURLs.xlsx"), null, true),
[edited for clarity?]
To my knowledge, there is no automagical way to get the current folder as a parameter to a query. That being said, you can use the "Manage Parameters" in the Power Query editor to create a parameter for folder that the end user can edit to be the correct path. In the Power Query Editor on the Home tab, use the "Manage Parameters" dialog to create a new parameter.
Thanks smoupre,
I am going to keep hunting, but for now will hardcode a folder as a parameter that can be updated
Hi @I_Like_Pi,
Currently, the available values for a parameter can only from a hardcode list. For the feature to get parameter available values from a query, I would recommend you submit a feature request in the idea forum: https://ideas.powerbi.com/forums/265200-power-bi-ideas.
Reference
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
http://biinsight.com/power-bi-desktop-query-parameters-part-1/
Regards,
Charlie Liao
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 43 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |