user3648721
user3648721

Reputation: 157

Make a text input dialog in Power BI

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

Answers (1)

Andrey Nikolov
Andrey Nikolov

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:

enter image description here

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:

enter image description here

Change the hard-coded file name and path with the name of the parameter defined above:

enter image description here

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:

enter image description here

Upvotes: 3

Related Questions