Power BI REST API functions
This article details the available Power BI REST API functions.
The features described in this section are currently in beta testing with selected customers and are subject to change.
GetCDF
Use this function to fetch data from CDF APIs using the HTTP GET method. The function auto-paginates CDF until the request cursor is exhausted. To ensure optimal performance, see the Cognite API specification for endpoints that support this HTTP method and the maximum supported page size for each endpoint.
Parameter | Type | Description |
---|---|---|
url | Text | The URL path to make the request, starting right after the project name. Examples: "/timeseries" , "/assets" . |
PostCDF
Use this function to fetch data from CDF APIs using the HTTP POST method. The function auto-paginates CDF until the request cursor is exhausted. To ensure optimal performance, see the Cognite API specification for endpoints that support this HTTP method.
Parameter | Type | Description |
---|---|---|
url | Text | The URL path to make the request, starting right after the project name. Examples: "/timeseries/list" , "/assets/list" . |
body | Text | A text representation of the JSON body to send with the request. Examples: "{}" , "{"limit": 1000}" . When available, set the limit parameter to the maximum supported value for the endpoint. See the Cognite API specification for optimal performance. When invoking this function with CogniteConnectorError . |
The PostCDF function offers auto-pagination for simple requests that expect a cursor at the top level of the request body. For more complex requests, you need to write a custom pagination logic using the Power Query M language. See the article on Power Query functions and example queries.
GraphQL
Use this function to fetch data from a CDF data model using GraphQL.
Parameter | Type | Description |
---|---|---|
space | Text | The external ID of the data model space. |
datamodel | Text | The external ID of the data model. |
version | Text | The version of the data model. |
query | Text | A text representation of the after:$cursor and pageInfo { hasNextPage endCursor } in the query to enable auto-pagination. Consider setting the first parameter to 1000 (maximum supported limit) for optimal performance. Example: "query MyQuery($cursor: String) { listMovies(first: 1000, after: $cursor) { items { name } pageInfo { endCursor hasNextPage }}}" . When invoking this function with Power BI, the query is presented as a multiline text area. You don't need to escape double quote characters. If you provide an invalid CogniteAPIError . |
variables | Text | A text representation of the "{""country"": ""Norway""}" . Don't include the cursor variable in the variables parameter. It is automatically managed by the connector. If you provide an invalid JSON body, the function returns an error of type CogniteConnectorError . |
The GraphQL function offers auto-pagination for GraphQL queries that include only one query expression with one pagination target, identified by the after: $cursor
and pageInfo { hasNextPage endCursor }
fields. For more complex queries, you need to write a custom pagination logic using the Power Query M language. See also the Power Query functions and example queries article. Before using the queries and variables in Power BI, always test them with the CDF Query Explorer to ensure they're correct.
ODataCDF
Use this function to fetch data from the Cognite ~~OData ~~services.
Parameter | Type | Description |
---|---|---|
url | Text | The URL path to the "publicdata" , "publicdata/Timeseries" . |
apiVersion | Text (optional) | The API version of the "v1" . The latest version of the asset-centric OData service is "v1" . For the data modeling "20230821" . |
ODataDataModel
Fetch data from a data model in CDF using the data modeling OData service.
Parameter | Type | Description |
---|---|---|
space | Text | The external ID of the data model space. |
datamodel | Text | The external ID of the data model. |
version | Text | The version of the data model. |
apiVersion | Text (optional) | The API version of the OData service to use when making the request. Default: "20230821" . The latest version of the data modeling OData service is "20230821" . |