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