Tutorial - Create a TIF Report for Power BI
The goal of this tutorial is to configure a TIF Report that connects with a Power BI system.
The tutorial includes reference configuration for an outbound integration that transfers payload to Power BI.
| Some steps might differ if there are future changes or updates to the Power BI REST API. |
Use Case Flow
In brief, the flow in this tutorial is the following:
-
A job is triggered.
-
Payload is extracted from ENOVIA.
-
The extracted payload is transferred to Power BI.
Preparations
In order to connect to Power BI, some preparation is necessary. This requires admin access to Power BI or Azure, to be able to authenticate against Power BI when sending data to that system.
Create and get Power BI credentials
To connect to Power BI, you need to create an application or client in Azure and get the necessary credentials.
Test credentials
You can test the credentials by using a REST client like Postman. The following is an example of how to test the credentials.
GET https://api.powerbi.com/v1.0/myorg/datasets
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1Q...
Alternatively, you can create a .pbids file and open it in the Power BI Desktop to test the connection. Example of a .pbids file:
{
"version": "0.1",
"connections": [
{
"details": {
"protocol": "http",
"address": {
"url": "https://api.powerbi.com/v1.0/myorg/datasets"
}
},
"options": {
"Headers": {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGc..."
}
}
}
]
}
Integration Configuration
On the TIF server we need to create XML configuration files for a job that extracts and transfers payload to Power BI.
Job configuration:
<Job>
<!-- Modify according to your integration -->
<Name>Power-BI Report</Name>
<CreateReport>
<Report>
<Payload ref="tvc:payload:report1/BOM.xml" />
<Transformer xslt="tvc:xslt:report1/BOMDataToPowerBIFormat.xslt">
<Property name="test1" value="value1"/>
</Transformer>
</Report>
<Destinations>
<Http id="http-1" url="https://api.powerbi.com/v1.0/myorg/datasets">
<Header name="Authorization" value="Bearer eyJ0eXAiOiJKV1QiLCJhbGc..." />
</Http>
</Destinations>
</CreateReport>
</Job>
The Transformer should output the data in the format that Power BI can understand. See Power BI REST API Documentation example: Power BI REST API - Post Dataset
{
"name": "SalesMarketingData",
"defaultMode": "Push",
"tables": [
{
"name": "Product",
"columns": [
{
"name": "ProductID",
"dataType": "Int64"
},
{
"name": "Name",
"dataType": "string"
},
{
"name": "Category",
"dataType": "string"
},
{
"name": "IsCompete",
"dataType": "bool"
},
{
"name": "ManufacturedOn",
"dataType": "DateTime"
},
{
"name": "Sales",
"dataType": "Int64",
"formatString": "Currency"
}
]
}
]
}