Skip to Content
TutorialsPower BI

Power BI

Power BI is where many companies combine their business data: ERP, sales, finance. By bringing UpBlue production data into Power BI, you get the complete picture: production per order next to the order value, energy use next to the energy bill.

The best dataset for Power BI is Operations: one row per production run, with metadata (order, customer, article) and the KPIs from your aggregate rules. That is exactly the shape Power BI likes.

⚠️

This integration uses the UpBlue API directly from Power Query (M code). It works well, but it is technical. If you are not comfortable with Power Query, contact us — we have a ready-made template and can help with the setup.

How it works

Power BI talks to the same API the UpBlue dashboards use. Two calls:

  1. Get a token — authenticate as a service user.
  2. Execute a query — the same data query a dashboard panel runs.

Create a service user with a token

Follow the M2M Authorization page: create a service user, add it to the organisation and create a token. For reading data, the service user needs access to the organisation.

Get a token in Power Query

The token from the token page is the client secret of the service user. Exchange it for an access token:

POST https://api.upblue.io/v1/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=<email address of the service user> &client_secret=<the token>

The response contains an access_token, valid for a limited time. In M code, do this call in a function so every refresh gets a fresh token.

Query the data

With the access token as Bearer, execute a data query:

POST https://api.upblue.io/v1/{tenant_uuid}/organisation/{organisation_uuid}/datasource/execute Authorization: Bearer <access_token> Content-Type: application/json

The body is a datasource query — the same pipeline a dashboard panel uses.

💡

Don’t write the query body by hand. Build the query in a dashboard panel first, until the panel shows exactly the data you want. Then open the dashboard menu → Raw edit and copy the datasource part of that panel. That JSON is your query body.

Load and refresh

Parse the JSON response in Power Query into a table. From here it is normal Power BI: relate the production data to your ERP tables on the order number and build your reports. Scheduled refresh keeps the data up to date.

Last updated on