Connect Microsoft Power BI to QPR ProcessAnalyzer: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
# On the '''Home''' ribbon, click '''Get data''' → '''Blank query'''.
# On the '''Home''' ribbon, click '''Get data''' → '''Blank query'''.
# The Power Query editor opens with a new empty query.
# The Power Query editor opens with a new empty query.
# Delete any existing content and paste the script below. Configure, username, password, model ID and the actual query to the script.
# Delete any existing content and paste the script below. Configure, username, password, model ID, the actual query and column data types to the script.
# Click '''Next'''.
# Click '''Next'''.
# Click '''Configure Connection'''.
# Click '''Configure Connection'''.
Line 105: Line 105:
</syntaxhighlight>
</syntaxhighlight>


=== Data types ===
=== Column Data Types ===
The following example shows how to convert different data types in the PowerBI query.
The data type for each column in the returned data needs to be specified correctly. The following example script shows how to convert each data type used by QPR ProcessAnalyzer.
<syntaxhighlight>
<syntaxhighlight>
TypedTable = Table.TransformColumnTypes(
TypedTable = Table.TransformColumnTypes(
Line 120: Line 120:
</syntaxhighlight>
</syntaxhighlight>


== Create First Report ==
== Create Report ==
When the data source and the semantic model are in place, you can continue with creating the first report:
# From the '''Visualizations''' pane, select a visual, for example a bar chart.
# From the '''Visualizations''' pane, select a visual, for example a bar chart.
# From the '''Data''' pane, drag fields onto the visual:
# From the '''Data''' pane, drag fields onto the visual:
Line 127: Line 128:
# Adjust formatting (title, colors, data labels) in the '''Format''' pane.
# Adjust formatting (title, colors, data labels) in the '''Format''' pane.
# Save the report: '''File''' → '''Save As'''.
# Save the report: '''File''' → '''Save As'''.
== Refreshing Data ==
* '''Manual refresh:''' In Power BI Desktop, click '''Refresh''' on the Home ribbon.
* '''Scheduled refresh (Power BI Service):''' After publishing, configure a scheduled refresh. Because the query calls a web API, you may need an appropriate gateway configuration and correctly configured credentials/privacy levels in the service.


== Caveats and Limitations ==
== Caveats and Limitations ==
Before implementing this integration, be aware of the following limitations. They affect how up to date the data is, how access is controlled, and how filtering behaves.
When implementing this integration, be aware of the following limitations.


=== Reports are not real time ===
=== Reports are not real time ===
Data shown in Power BI is a snapshot taken at the time of the last data load. It is '''not''' a live connection to QPR ProcessAnalyzer. The data is updated only when a refresh is performed, either:
Data shown in Power BI is a snapshot taken at the time of the last data load. It is not a live connection to QPR ProcessAnalyzer. The data is updated when a refresh is performed, either:
 
* '''Manual refresh:''' In Power BI Desktop, click '''Refresh''' on the Home ribbon.
* '''Manually''' &ndash; by clicking '''Refresh''' in Power BI Desktop, or
* '''Scheduled refresh (Power BI Service):''' After publishing, configure a scheduled refresh. Because the query calls a web API, you may need an appropriate gateway configuration and correctly configured credentials/privacy levels in the service.
* '''On a schedule''' &ndash; by configuring a scheduled refresh in the Power BI Service.
 
As a result, reports may not reflect the most recent changes in the underlying QPR ProcessAnalyzer model until the next refresh runs.


=== Shared (common) QPR ProcessAnalyzer credentials ===
=== Shared QPR ProcessAnalyzer credentials ===
The connection authenticates using a single set of QPR ProcessAnalyzer credentials embedded in the query, rather than each report user's individual account. This has important consequences:
The connection authenticates using a single set of QPR ProcessAnalyzer credentials embedded in the query, rather than each report user's individual account. This has important consequences:
 
* All Power BI users effectively see data through the same QPR ProcessAnalyzer account, regardless of who they are.
* All Power BI users effectively see data through the '''same''' QPR ProcessAnalyzer account, regardless of who they are.
* User-specific permissions and per-user access restrictions defined in QPR ProcessAnalyzer are not applied to individual Power BI users.
* '''User-specific permissions''' and per-user access restrictions defined in QPR ProcessAnalyzer are '''not''' applied to individual Power BI users.
* Any access control must be handled on the Power BI side (for example, workspace permissions or row-level security), not through the QPR ProcessAnalyzer.
* Any access control must be handled on the Power BI side (for example, workspace permissions or row-level security), not through the QPR ProcessAnalyzer account.


=== Source data filtering is not applied ===
=== Source data filtering is not applied ===
Filters applied to cases or events '''on the QPR ProcessAnalyzer side cannot be applied''' through this integration. The query retrieves data according to the defined dimensions and values without any interactive source-level filtering.
Filters applied to cases or events on the QPR ProcessAnalyzer side cannot be applied through this integration. The query retrieves data according to the defined dimensions and values without any interactive source-level filtering.


* Only filtering performed '''on the Power BI side''' (slicers, visual filters, page/report filters) takes effect.
* Only filtering performed on the Power BI side (slicers, visual filters, page/report filters) takes effect.
* This means the full result set defined by the query is always retrieved before Power BI filtering is applied, which can affect the volume of data transferred and report performance.
* This means the full result set defined by the query is always retrieved before Power BI filtering is applied, which can affect the volume of data transferred and report performance.
* To limit data at the source, you must change the query itself (the <code>RequestBody</code> dimensions and values) rather than rely on interactive filtering.
* To limit data at the source, you must change the query itself rather than rely on interactive filtering.

Revision as of 19:32, 23 August 2026

This guide explains how to connect Microsoft Power BI to QPR ProcessAnalyzer using the Power Query Web.Contents function. It walks you through creating the data source, building the semantic model, setting privacy levels, defining column data types, and producing the first report.

The connection works by authenticating against the QPR ProcessAnalyzer REST API to obtain an access token, then running an expression query against a selected model to retrieve data as a table.

Overview

The connection is built in the Power Query editor. The query performs three steps:

  1. Get an access token: sends the username and password to the token endpoint and reads the returned access token.
  2. Run an expression query: sends a QPR ProcessAnalyzer query to the api/expression/query endpoint using the access token.
  3. Parse and shape: converts the returned data into a Power BI table.

Create Data Source and Semantic Model

  1. Open the Power BI Desktop or Power BI Service.
  2. On the Home ribbon, click Get dataBlank query.
  3. The Power Query editor opens with a new empty query.
  4. Delete any existing content and paste the script below. Configure, username, password, model ID, the actual query and column data types to the script.
  5. Click Next.
  6. Click Configure Connection.
  7. Click Edit connection.
  8. Select Authentication kind is Anonymous, and Privacy level is Public or Organizational as appropriate for your organization.
  9. Click Connect.
  10. Click Create a report.
  11. Specify a name for the new semantic model.
  12. Click Create.
  13. Report editor opens.

Power Query Script

let
    // ================= Configuration =================
    Url  = "https://server.onqpr.com/qprpa/",
    UserName = "qpr",
    Password = "demo",
    ModelId  = 123,
    RequestBody = [
        Dimensions = {
            [
                Name       = "Company Code",
                Expression = "Column(""Company Code"")"
            ]
        },
        Values = {
            [
                Name                = "Count",
                AggregationFunction = "count"
            ]
        },
        Ordering = {
            [
                Name      = "Count",
                Direction = "Descending"
            ]
        },
        Root             = "Cases",
        ModelId          = ModelId,
        ContextType      = "model",
        ProcessingMethod = "dataframe"
    ],

    // ================= Step 1: Get access token =================
    TokenBody = Uri.BuildQueryString([
        grant_type = "password",
        username   = UserName,
        password   = Password
    ]),
    TokenResponse = Web.Contents(
        Url,
        [
            RelativePath = "token",
            Headers = [
                #"Content-Type" = "application/x-www-form-urlencoded",
                #"Accept"       = "application/json"
            ],
            Content = Text.ToBinary(TokenBody)
        ]
    ),
    TokenParsed = Json.Document(TokenResponse),
    AccessToken = TokenParsed[access_token],

    // ================= Step 2: Run query =================
    QueryResponse = Web.Contents(
        Url,
        [
            RelativePath = "api/expression/query",
            Headers = [
                #"Content-Type"  = "application/json",
                #"Accept"        = "application/json",
                #"Authorization" = "Bearer " & AccessToken
            ],
            Content = Json.FromValue(RequestBody)
        ]
    ),
    Parsed = Json.Document(QueryResponse),
    AsTable = Table.FromRecords(Parsed),

    // ================= Step 3: Set column types =================
    TypedTable = Table.TransformColumnTypes(
        AsTable,
        {
            {"Company Code", type text},
            {"Count",        Int64.Type}
        }
    )
in
    TypedTable

Column Data Types

The data type for each column in the returned data needs to be specified correctly. The following example script shows how to convert each data type used by QPR ProcessAnalyzer.

TypedTable = Table.TransformColumnTypes(
	AsTable,
	{
		{"TextColumn", type text},
		{"IntegerColumn", Int64.Type},
		{"DecimalColumn", type number},
		{"DateColumn", type date},
		{"BooleanColumn", type logical}
	}
),

Create Report

When the data source and the semantic model are in place, you can continue with creating the first report:

  1. From the Visualizations pane, select a visual, for example a bar chart.
  2. From the Data pane, drag fields onto the visual:
    • Drag Company Code to the Y-axis (or Axis).
    • Drag Count to the X-axis (or Values).
  3. Adjust formatting (title, colors, data labels) in the Format pane.
  4. Save the report: FileSave As.

Caveats and Limitations

When implementing this integration, be aware of the following limitations.

Reports are not real time

Data shown in Power BI is a snapshot taken at the time of the last data load. It is not a live connection to QPR ProcessAnalyzer. The data is updated when a refresh is performed, either:

  • Manual refresh: In Power BI Desktop, click Refresh on the Home ribbon.
  • Scheduled refresh (Power BI Service): After publishing, configure a scheduled refresh. Because the query calls a web API, you may need an appropriate gateway configuration and correctly configured credentials/privacy levels in the service.

Shared QPR ProcessAnalyzer credentials

The connection authenticates using a single set of QPR ProcessAnalyzer credentials embedded in the query, rather than each report user's individual account. This has important consequences:

  • All Power BI users effectively see data through the same QPR ProcessAnalyzer account, regardless of who they are.
  • User-specific permissions and per-user access restrictions defined in QPR ProcessAnalyzer are not applied to individual Power BI users.
  • Any access control must be handled on the Power BI side (for example, workspace permissions or row-level security), not through the QPR ProcessAnalyzer.

Source data filtering is not applied

Filters applied to cases or events on the QPR ProcessAnalyzer side cannot be applied through this integration. The query retrieves data according to the defined dimensions and values without any interactive source-level filtering.

  • Only filtering performed on the Power BI side (slicers, visual filters, page/report filters) takes effect.
  • This means the full result set defined by the query is always retrieved before Power BI filtering is applied, which can affect the volume of data transferred and report performance.
  • To limit data at the source, you must change the query itself rather than rely on interactive filtering.