Forum Discussion
Parameter as Search option
- Create a new table in Power BI that contains the list of locations you want to use as parameters.
For example, you can create a table named Locations with a column LocationName. - Add a slicer visual to your report.
Set the slicer to use the LocationName column from the Locations table.
This will allow users to select a location from the dropdown list. - Go to the Home tab and click on Transform Data to open Power Query Editor.
Edit your query to use the selected value from the slicer. You can do this by creating a parameter in Power Query and setting its value based on the selected slicer value.
For example, you can create a parameter named SelectedLocation and set its value using a DAX expression like SELECTEDVALUE(Locations[LocationName])
Use the SelectedLocation parameter in your API query to fetch data for the selected location.
HI bhanu_gautam, is it really possible?
If we talk about Import storage mode, I expect that PowerQuery is executed when semantic model is refreshing, therefore, any parameter value for API (to be used in PowerQuery) should be provided before semantic model refresh. In such case, when user is interacting with refreshed report (e.g. selecting some value in a slicer visual), it will not affect the refresh, thefore there will be no new API call. Isn't it so?
Maybe it works in a different manner when using DirectQuery, however even in this case, I don't expect that user can change parameter through interaction with a slicer on report canvas.
As of my knowledge, the only way to interact with parameters if not using PowerBI desktop is through "Semantci Models" in PowerBI service:
If you can provide some references where to learn more about your suggestion I'd be very grateful 🙂 Thank you!
- bhanu_gautam2 years ago
Super User
Sergii24 , My bad yes you are right it will not work