Forum Discussion
Power BI reports data connect with REST API and reload data on Refresh dashboard.
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.
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
- ibarrau6 years agoSuper User
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/529756
And check this post to add headers: https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-in-power-query-and-power-bi-m-code/
Hope this helps.
- Anonymous6 years agoNot 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?
- ibarrau6 years agoSuper User
No you can't. What we recommend is to get all the data and then filter it with slicer.
Regards,
- GilbertQ6 years agoSuper User
Hi Anonymous
Here is a previous question if you click on the link it will explain and show you how to get this workinghttps://community.powerbi.com/t5/Power-Query/Pull-data-from-a-REST-API-Authentication/td-p/246006