Accessing web services using Power BI
Power BI already has default features that allow you to access the data exposed by a web service into Power Query. There are two main modes:
- Via the GUI (click on Get data, then Web, and then you can set advanced options if needed).
- Through the M language, using the
Web.Contents()
function.
The use of the GUI is very cumbersome and almost always does not lead to the desired results. The only way to effectively connect to a web service using native Power BI features is to write M code. Writing code in M is not too difficult. However, there are some complications in using the Web.Contents()
function that arise when publishing a report that makes use of it to the Power BI service. In short, it is necessary to be careful when you have to build the URL to use in the GET
request in a dynamic way, making use of the relative path and the query options. If you do not use this particular construct, the service will not be able to refresh...