Power BI
Configuration
Open Power BI and click "Get data from other sources"
In the dialog that appears, type "blank" into the search bar, then select "Blank Query" and click "Continue"
The Query Editor will appear with
Query1
created for you. Right clickQuery1
and select "Advanced Editor". This will open the code interface.Delete whatever default value appears and paste the following code into the box
NOTE: this code includes a default query and filter that should work for most users if you use the
data
table.
Click "Done". An error should appear telling us that we need to provide the missing parameters
To start declaring the parameters, click "Manage Parameters". This will open a dialog.
Click "New"
Enter the parameter name. It must match the name provided here (or in the error) exactly (the values are case-sensitive)
Enter the value specific to your use case
The required parameters are as follows
cloud
The URL of the cloud you want to connect to
workgroupId
The ID of the workgroup you wish to extract data from
You can find the workgroup ID in Admin -> Workgroup
table
The table you wish to extract data from
data, solar, wind10m
API token
Secret credentials used to authenticate with the API
Once all the parameters are populated, the error "Please specify how to connect" will appear. Click "Edit credentials"
Select "Anonymous" and click "Connect". NOTE: The connection is not actually anonymous, we simply provide the credentials as a parameter so that it can be used in the script.
This will return a List of Records which is the reply from the API
Import the data into Power BI
Modifying the query
To modify the query, we need to look at the Query
object:
If you have already read the API Quick Start Guide, this should look very familiar. If you haven't read that article, please read it first and then return here.
TL;DR
Don't touch
rows
Add filters using the
makeFilter()
function following the pattern shown in the example
Other suggestions
Once you've finished building your query, add the
scroll = "true"
parameter. This will enable you to import more than the default cap of 10,000 records. You can potentially import millions of records if your computer can handle it.makeFilter
will convert any object you provide into JSON texttimeframe
andsort
, in fact all the parameters, work exactly like they do in the API Search Functions
Last updated
Was this helpful?