Forum Discussion

RockOfRockyTop's avatar
RockOfRockyTop
Frequent Visitor
8 years ago
Solved

Rest API With User Selected Parameters As Data Source

I'm new to Power BI and have no experience developing in neither it nor Power Query. I have a RESTful API that I would like to use as a data source for my dashboards. The methods that are part of this API use query string parameters. How do I go about making calls from Power BI to this API with parameters that can be changed on the fly by the user. For instance, I have multiple methods that expect a start date and end date. I would like for the user to have the ability to make a selection on a Power BI form and that be used in the call to the API. Is what I'm describing something that can be accomplished?

 

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    RockOfRockyTop,

    To add data source parameter in your URL, please check my reply in the following similar threads.

    http://community.powerbi.com/t5/Desktop/Dynamic-connection-to-Web-URL/m-p/346607#M155589
    https://community.powerbi.com/t5/Integrations-with-Files-and/Parameters-for-JSON-API-data-Maintain-Query-daily/m-p/157925/highlight/true

    After create reports in Power BI Desktop, you may also need to create Power BI template file for user to instantiate.

    Regards,
    Lydia

    • Anonymous's avatar
      Anonymous
      Not applicable

      how about power bi embedded? power bi ambedded show the reports without licence power bi, which is user cannot inject parameter into power bi API.

    • RockOfRockyTop's avatar
      RockOfRockyTop
      Frequent Visitor

      Anonymous thank you for your response. I'm now pulling data from my API. My follow up question is this, I'm going to have multiple API calls that will use the same Start and End dates. Is there any way to select these dates and all of the queries use them?

      • Anonymous's avatar
        Anonymous
        Not applicable

        RockOfRockyTop,

        Do you have multiple connections for these API calls in PBIX file? If so, these queries can use the startdate parameter and enddate parameter you create.

        Regards,
        Lydia

    • Farhad88's avatar
      Farhad88
      Helper I

      Hi RockOfRockyTop ,

       

      Thanks for providing the solutions in the similar threads. I visited them, however, I need to cover the following scenario which is a little different (screenshot attached):

      My client wants to retrieve data from a Rest API data source based on a daynamic parameter (e.g., StartDate). And he wants to select the parameter value using a slicer. 

      As you know, it is fairly easy to do so using DirectQuery on SQL data source, but I cannot use the same solution for a Rest API data source (because the value of the parameter would be always the same as its defualt value!). 

      Do you think there might be any solution to this issue?

       

      Thanks and best regards,

      Hossein