> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Power BI REST API functions

> Available Power BI REST API functions to use with the Cognite APIs for fetching and transforming data.

<a id="getcdf" />

## GetCDF

Use this function to fetch data from Cognite APIs using the HTTP GET method. The function auto-paginates <span translate="no">CDF</span> until the request cursor is exhausted. For optimal performance, see the [Cognite API specifications](/api-reference/concepts/20230101/api-description) 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 directly after the project name. For example, `"/timeseries"`, `"/assets"`. |

<a id="postcdf" />

## PostCDF

Use this function to fetch data from Cognite APIs using the HTTP POST method. The function auto-paginates <span translate="no">CDF</span> until the request cursor is exhausted. For optimal performance, see the [Cognite API specifications](/api-reference/concepts/20230101/api-description) for endpoints that support this HTTP method.

| Parameter | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url`     | Text | The URL path to make the request, starting directly after the project name. For example, `"/timeseries/list"`, `"/assets/list"`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `body`    | Text | A text representation of the JSON body to send with the request. For example, `"{}"`, `"{"limit": 1000}"`. When available, set the `limit` parameter to the maximum supported value for the endpoint. For optimal performance, see the [Cognite API specifications](/api-reference/concepts/20230101/api-description). When invoking this function with <span translate="no">Power BI</span>, the query is presented as a multiline text area.You don't need to escape double quote characters. If you provide an invalid JSON body, the function will return an error of type `CogniteConnectorError`. |

<Info>
  The `PostCDF` function offers auto-pagination for simple requests that expect a `cursor` field (`string`) at the top level of the request body. For more complex requests, write a custom pagination logic using the <span translate="no">Power Query</span> M language. See [Power Query functions and example queries](/cdf/dashboards/references/rest/powerbi_rest_examples#advanced-examples).
</Info>

<a id="graphql" />

## GraphQL

Use this function to fetch data from a <span translate="no">CDF</span> data model using <span translate="no">GraphQL</span>.

| 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 <span translate="no">GraphQL</span> query to send when making the request. Include `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. <br /> For example, `"query MyQuery($cursor: String) { listMovies(first: 1000, after: $cursor) { items { name } pageInfo { endCursor hasNextPage }}}"`. <br /> 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 <span translate="no">GraphQL</span> query, the function returns an error of type `CogniteAPIError`. |
| `variables` | Text | A text representation of the <span translate="no">JSON</span> variables to send when making the request. <br /> For example, `"{""country"": ""Norway""}"`. <br /> Don't include the `cursor` variable in the `variables` parameter, since this is automatically managed by the connector. If you provide an invalid JSON body, the function returns an error of type `CogniteConnectorError`.                                                                                                                                                                                                                                                                                                                                                              |

<Info>
  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, write a custom pagination logic using the <span translate="no">Power Query</span> M language. See [Power Query functions and example queries](/cdf/dashboards/references/rest/powerbi_rest_examples#advanced-examples). Always test the queries and variables in <span translate="no">Power BI</span> with <span translate="no">CDF Query Explorer</span> to ensure they're correct.
</Info>

<a id="odatacdf" />

## ODataCDF

Use this function to fetch data from the <span translate="no">Cognite</span> [<span translate="no">OData</span> services](/cdf/dashboards/references/odata).

| Parameter    | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url`        | Text            | The URL path starting from the project name only. **Do not include the cluster or full URL** - the connector handles this automatically. Examples: `"publicdata"` for the project root, `"publicdata/Timeseries"` for time series data, `"publicdata/Assets"` for assets. Note: This differs from the full OData URL format used in other clients. For guidance on constructing OData query paths and available endpoints, see the [OData Services documentation](/cdf/dashboards/references/odata). |
| `apiVersion` | Text (optional) | The API version of the <span translate="no">OData</span> service to use with the request. The default value is `"v1"`. The latest version of the asset-centric OData service is `"v1"`. For the data modeling <span translate="no">OData</span> service, the latest version is `"20230821"`.                                                                                                                                                                                                         |

<a id="odatadatamodel" />

## ODataDataModel

Use this funtion to fetch data from a <span translate="no">CDF</span> data model using the data modeling <span translate="no">OData</span> 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. The default value is `"20230821"`. The latest version of the data modeling OData service is `"20230821"`. |
