For the complete documentation index, see llms.txt. This page is also available as Markdown.

Power BI Integration

How to integrate Microsoft Power BI with Connectware, including creating a streaming semantic model, pushing live shop floor data to the REST API, and building a real-time dashboard.

This guide describes how to integrate Microsoft Power BI with Connectware. You configure a service commissioning file that pushes live shop floor data into a Power BI streaming semantic model, so dashboard tiles update within seconds of a machine publishing a value. A complete example file is available at the end of this guide.

Objectives

  • Creating a streaming semantic model in the Power BI service.

  • Establishing a connection between Connectware and the Power BI REST API.

  • Pushing shop floor data from MQTT topics into the streaming semantic model.

  • Visualizing the live data on a Power BI dashboard.

Prerequisites

To follow this guide, you will need the following:

Connectware and Power BI Integration

Power BI accepts real-time data through streaming semantic models, formerly known as streaming datasets. When you create a streaming semantic model in the Power BI service, Power BI generates a push URL on api.powerbi.com. The URL contains a resource key that authenticates the request, so no OAuth configuration is required. Connectware sends rows to this URL through the HTTP/REST connector, one POST request per MQTT message.

Retirement of Real-Time Streaming in Power BI

The MQTT topics in this guide follow an ISA-95-style equipment hierarchy (<enterprise>/<site>/<area>/<line>/<cell>). The mapping subscribes with wildcards across all levels, so any machine in the hierarchy is picked up without changing the integration.

Creating a Streaming Semantic Model in Power BI

You create the streaming semantic model in the Power BI service and define its row schema there. The field names and types must match the data that Connectware sends later.

  1. In the Power BI service, open an existing dashboard or create a new one.

  2. Select Edit > Add a tile.

  3. Select Custom Streaming Data and select Next.

  4. Select Add streaming semantic model.

  5. Select API and select Next.

  6. Enter a name for the semantic model and define the values from the stream. This guide uses the fields timestamp (DateTime), line (Text), and temperature (Number).

  7. Enable Historic data analysis if you want to build reports on the collected data. Without it, Power BI keeps the data only in a temporary cache for streaming tiles and discards it after about one hour.

  8. Select Create.

Power BI now shows the push URL of the semantic model. It has the following form:

Power BI Connection Properties

The connection to Power BI requires the parts of the push URL. We add them as parameters to the service commissioning file, so you can set them when you install the service.

Do not worry about copying the service commissioning file snippets together into one, the complete example file is available at the end of this guide.

  • tenantId: The first identifier in the push URL, after /beta/.

  • datasetId: The identifier in the push URL, after /datasets/.

  • pushKey: The resource key, the value of the key query parameter. Copy it exactly as it appears in the push URL, it is already URL-encoded.

  • topicRoot: The root of the MQTT topic hierarchy. Defaults to enterprise.

Power BI Connection

To connect to the Power BI REST API, we set up a Cybus::Connection resource that uses the HTTP/REST connector. The connection only defines the host, because the resource key in the endpoint path handles the authentication.

Pushing Shop Floor Data to Power BI

The rows endpoint of the streaming semantic model expects a POST request with a JSON array of rows as the body. Each row is an object whose property names match the fields that you defined in the schema.

We define a write endpoint for the rows path and a mapping that feeds it from the MQTT topic hierarchy. The HTTP/REST connector expects the request body in the body property of the message (see Publishing Data to REST Servers). The transform rule wraps the incoming payload into the rows array and adds the current time as the timestamp field, so machines can publish their data without knowing about these conventions.

Any message published to a matching topic, for example enterprise/hamburg/assembly/line-1/press-01/telemetry, now becomes one row in the semantic model. The property names in the payload must match the schema fields:

The transform rule turns this payload into the rows array that Power BI expects as the request body:

If your machines already publish a timestamp, remove the $merge call and use { "body": [ $ ] } instead. Power BI accepts DateTime values in ISO 8601 format.

Ingestion Limits

Power BI limits how fast you can push data. A streaming semantic model accepts up to five requests per second with up to 15 KB per request. With Historic data analysis enabled, the model is also a push semantic model, which accepts one request per second with up to 16 MB per request and up to one million rows per hour. A request that exceeds the streaming limit but stays within the push limit still stores the data, but streaming tiles temporarily fail. For details, see Real-time streaming in Power BI in the Microsoft documentation.

Connectware sends one request per MQTT message. If your machines publish faster than the limits allow, reduce the message rate before it reaches the endpoint, for example with Rule Engine rules that filter or aggregate the data.

Visualizing the Data in Power BI

To display the live data, add a streaming tile to a dashboard:

  1. On the dashboard, select Edit > Add a tile.

  2. Select Custom Streaming Data and select Next.

  3. Select your streaming semantic model and select Next.

  4. Choose a visualization type, for example a line chart with timestamp as the axis and temperature as the value.

If you enabled Historic data analysis, you can additionally build regular Power BI reports on the semantic model, with the full set of report features such as filtering and data alerts.

Verifying the Integration

  1. Install the service and set the parameters to the values from your push URL.

  2. Check that the connection is in the Connected state on the service details page in the Admin UI.

  3. Publish a test message with the schema fields to enterprise/hamburg/assembly/line-1/press-01/telemetry, for example with an MQTT client or the Admin UI.

  4. Check that the streaming tile on your dashboard updates within a few seconds.

  5. The result of every HTTP request is published to the /res topic of the endpoint. Use the Data Explorer to inspect it. If Power BI rejects a request, the message on the /res topic contains an error property with the HTTP status. A 404 Not Found status usually means that the dataset ID or the resource key is wrong, and a 400 Bad Request status usually means that the rows do not match the schema.

Service Commissioning File Example

Last updated

Was this helpful?