Forum Discussion

Shivam8683's avatar
Shivam8683
Regular Visitor
2 years ago

Parameter as Search option

I have fetched data from an API. The data is about weather. It is giving me static location. But with the help of parameter i have made dimension dynamic. Now to change location every time i have to go to transform data>Edit parameter and change the parameter from there. Is there any other easy way to change parameter like a search box

7 Replies

    • Shivam8683's avatar
      Shivam8683
      Regular Visitor

      But i don't have any location column. The api gives me data of whatsoever the location i enter in parameter 

      • bhanu_gautam's avatar
        bhanu_gautam
        Super User
        1. 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.
        2. 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.
        3. 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.