Reputation: 157
I'm trying to make a Power BI template, where upon open, will prompt user to input the path to the source data file. How can I do that, with what language?
Upvotes: 1
Views: 2155
Reputation: 13450
You can use Power BI Templates and connection specific parameters to achieve that.
First create your report the normal way. When it is ready, define a text parameter for the file name - click Transform data
to open Power Query Editor
, and then click Manage parameters
and add a new parameter:
Make sure the type is Text
and set the current value to be the path to the file that you used to build the report. The open your query (or queries) in the Advanced editor
(right click the query) to show the M code and locate the file name and path to the source file:
Change the hard-coded file name and path with the name of the parameter defined above:
Close and apply Power Query Editor
and from File
-> Save as
save your report as a template (.pbit file). When this template file is opened, it will prompt for entering values for the defined parameters, i.e. for the path to the data source file:
Upvotes: 3