Power BI’s web portal and desktop application are slightly different, but this tutorial will work for both.
Getting API Data
- Open up Power BI and select “Edit Queries”.
- Click “New Source” and select “Blank Query”.
- Next, select “Advanced Editor”.
- In the editor, enter the API’s address and any header information needed for that api.
let apiUrl = "https://xxxxxxx/api/info", options = [Headers =[#"Subscription-Key"="xxxxxxxxxxxxxxxxxxxxx"]], result = Web.Contents(apiUrl , options) in result
- After you add the Query, you will then need to “Connect”. In Power BI Desktop, a warning message pops up letting you know this. Click “Edit Credentials”
- The Access Web content pop-up will show a few different ways to set up you API credentials. For this example, we just needed to include a “Key” in the header. Since we already did that, all we have to do is press “Connect”.
Thats it! You should now be connected and see the results of the api call. You can “drill” into the results and select what information and object are important to you. As you do this, check out “Advanced Editor” again. You will see that slight changes are made to it as you configure the data you want.