Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Power BI reports data connect with REST API and reload data on Refresh dashboard.

Hi All,

 

I am new to Power BI, Sorry for my stupid question but I am trying to build the dashboard which takes data from REST API and everytime I refresh/reload the Dashboard of Power BI it should fetch the data from REST API to show. 

 

is it possible? if yes, Please help. I tried multiple things but after publishing report it is not taking data from REST API. I mean its content is not changing even the API response data is changed.

 

 

Please let me know how I should proceed to do acheive this.

11 REPLIES 11
Icey
Community Support
Community Support

Hi @Anonymous ,


Is this problem solved?


If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.


Best Regards
Icey

ibarrau
Super User
Super User

Hi, that is not exactly possible. You have two scenarios that can help.

1- You schedule refresh the rest api get data methods for your dashboard. (Up to 8 times a day in pro/free licence)

2- You can create a Streaming data set. In this case you can develop an app to POST the data to Power Bi service. For example trigger your data changes to move them to power bi at the exact moment. This way power bi will give you an URL to post the data with a body json as an example.

 

Regards, hope this helps

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hi there

Firstly I always say that there are no stupid questions!

As mentioned above, what you would need to do, is to create the call to the REST API using Power BI Desktop.

You would then need to configure the scheduled refresh if all your data is only coming from a web based REST API. This will allow your data to be refreshed on the schedule.

Once the above is done, you can then create a dashboard by pinning visuals from your Power BI Report to a dashboard.

The dashboard tiles will automatically update when the underlying data is refreshed.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

Thanks @GilbertQ  I will use schedule refresh but I have Graphql API which takes the request params like

       My POST API looks something like https://**************.com/api/v1/get_data

{
  packMarketPent(periods: {start_date: "2019-01-01", end_date: "2019-10-01"}){
    channel
    service_name
    metric_absolute_actual
  }
}

 

Can you pls help me whats the best possible way to use this API in POWER BI 

Hi @Anonymous 

Here is a previous question if you click on the link it will explain and show you how to get this working

 

https://community.powerbi.com/t5/Power-Query/Pull-data-from-a-REST-API-Authentication/td-p/246006





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

I have connected several times to APIs but without body. I think it is possible but it might be tricky. Use the Web connector to get data and add the URL. (In advance mode you have an option for the headers)

Then check this post to create the body: https://community.powerbi.com/t5/Power-Query/Passing-Variables-in-API-Post-Request-JSON-Body/td-p/52...

And check this post to add headers: https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-i...

 

Hope this helps.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Thanks for your reply but i have a requirement to show the data from API based on slicer selection in the report.

 

so can we  use the Selected value from the Slicer in the Advanced Editor/Power Query Editor?

No you can't. What we recommend is to get all the data and then filter it with slicer. 

 

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

But Thats the recommendation but is there any work around to get the data from API using slicer value?

 

because I am wondering that there is a option for direct query where we can pass the slicer value using R. 

There should be some workaround where we can pass the slicer value to the API. if anyone know how to crack this pls comment OR lets solve this togther. 

 

Hi Jaswinder, the way I have solved this problem has been to use a parameter and pass that to the PowerQuery. I realise that this is a less than perfect solution. To break the problem down into it's components, you have the slicer but no way to pass the slicer selected value from DAX, the presentation layer, to PowerQuery, the data layer. Parameters are also available in the model as what-if parameters, which is closer to what you need, but then they are not available to Power Query. At least I can't work out how to do that. On the positive side it is possible to do what you want in Excel Power Query by accessing the worksheet from PowerQuery. Another way might be to put the slicer on a visual that can update a stored value outside of the PowerBI system and then retrieve that value using Power Query

You can't make an http request from DAX once the model is created after you Close & Apply. That is why you have to take the data before doing that with Edit queries. There is no way to call an API with a slicer visualization filter.

 

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors