Forum Discussion
Power BI reports data connect with REST API and reload data on Refresh dashboard.
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
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,
- Anonymous6 years agoNot 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.