Skip to content

Power BI Service

This document outlines the steps required to integrate Power BI with DataOS, ensuring a seamless connection to the Data Product Hub.

Prerequisites

Before proceeding with the data gateway configuration, ensure the following components are installed:

  • Power BI Desktop installed on the system(version released after June 15, 2023).

  • A Power BI service account.

  • Npgsql version v4.0.10 (or earlier, up to v4.0.16).

  • On-premises data gateway.

  • Ensure that necessary ports (such as 6432) and services are whitelisted.

Installing the on-prem data gateway

  1. Download the gateway installer from Microsoft.

  2. Run the installer, keep the default installation path, accept the terms, and select Install.

    DPH

  3. Enter the email address for your Office 365 organization account, then select Sign in.

    DPH

    You're now signed in to your account.

  4. Select Register a new gateway on this computer > Next.

    DPH

  5. Enter a name for the gateway. The name must be unique across the tenant. Also, enter a recovery key. You'll need this key if you ever want to recover or move your gateway. Select Configure.

    DPH

  6. Review the information in the final window. Select Close.

    DPH

Now that you've installed a gateway, install a npgsql.

Installing Npgsql for PostgreSQL connectivity

  1. Download the Npgsql.msi installer from GitHub Make sure to download the v4.0.10 or earlier version.

  2. Open the installer and click Next to begin the setup.

    DPH

  3. Accept the terms and conditions of use and click Next.

    DPH

  4. Ensure 'Npgsql GAC Installation' is selected. Verify that both the default-checked and unchecked files are selected before proceeding.

    DPH

  5. Click 'Install' to begin the installation.

    DPH

  6. Once completed, click Finish to exit the setup wizard.

Create and publish a Power BI Desktop file

Follow the below steps to sync the integrate the productaffinity semantic model with the Power BI and create a basic Power BI report Publish the report to the Power BI service to get a Power BI semantic model.

Step 1: Navigate to the BI sync option

In Data Product Hub, choose a Data Product let's say product-affinity Navigate to the Access Options tab on the Data Product Hub application on DataOS. Within a specific Data Product, and under the BI Sync options, select 'Excel and Power BI'. Click on the download icon to download the .pbip file.

DPH

Step 2: Extract the files

Once downloaded, locate the ZIP file in your file manager and extract it to your desired destination. The necessary files will then be available.

DPH

The folder stores the main components of a Power BI project for syncing the Lens Model (here Product Affinity), including folders like the.Report and .SemanticModel.

  • public_sales360-table.Report: This folder contains definition.pbir file related to the report definition in Power BI. These files define the visual representation of data, such as tables and charts, without storing actual data. They connect the semantic model and data sources to create the report views.

  • public-sales360-table.SemanticModel: This folder contains files that define the underlying data model for your Power BI project. The semantic model plays a crucial role in managing how Power BI interacts with data, setting up relationships, hierarchies, and measures.

    • definition.bism: This file represents the Business Intelligence Semantic Model (BISM). It defines the structure of your data, including data sources, relationships, tables, and measures for your Lens semantic model. The .bism file holds essential metadata that helps Power BI understand and query the data, forming the core of the data model for report creation and analysis.

    • model.bim: Power BI uses the .bim file to generate queries and manage interactions with the dataset. When you build reports or dashboards in Power BI, it references this semantic model to ensure the correct structure is applied to the data.

  • public-sales-360-table.pbip: This file serves as a Power BI project template or configuration file. Power BI uses files like .pbip or .pbix to encapsulate reports, datasets, and visualizations. The .pbip file ties together the semantic model and report definitions from the other folders, acting as the entry point for working on the project in Power BI Desktop or the Power BI service.

Step 4: Open the file in Power BI and connect

Open the public_productaffinity file in Power BI Desktop. A popup will appear prompting you to enter your 'DataOS username' and 'API key'.

After entering your credentials, click 'Connect'. A confirmation popup will appear; click 'OK' to proceed.

Customize and create your report as required.

DPH

Step 5: Publish the report to PowerBI Service Account

On the Home tab, select Publish.

On the Publish to Power BI screen, choose My Workspace, and then select Select. Sign in to the Power BI service if necessary.

When the Success message appears, select Open productaffinity.pbip in Power BI. If prompted, sign in to your Power BI service account to complete the process.

DPH

Configuring a data gateway for PostgreSQL interface

In Power BI Desktop, you connected directly to your on-premises PostgreSQL interface. In the Power BI service, you need a data gateway to act as a bridge between the cloud and your on-premises network. Follow these steps to add your on-premises PostgreSQL interface as a data source to a gateway and connect your semantic model to this data source.

Add a Gateway connection

To connect Power BI to the on-premises PostgreSQL interface via the data gateway, follow these steps:

  1. In Power BI Service, navigate to the workspace where the semantic model has been published.

  2. Locate the productaffinity semantic model in the content list.

    DPH

  3. From the File dropdown, select Settings.

    DPH

  4. In the Settings screen, locate and expand the Gateway and cloud connections section, and click the Create a connection button.

    DPH

  5. A New Connection screen will appear, here ensure On-premises is selected and complete the following fields(some fields are pre-configured):

    DPH

  6. Complete the following fields(some fields are pre-configured):

    • Gateway Cluster Name: Enter or verify the configured gateway name.
    • Connection Name: Provide a descriptive name (e.g., productaffinity-testing).
    • Connection Type: Ensure PostgreSQL interface is selected.
    • Server: Enter the PostgreSQL interface instance (e.g., tcp.dataos-training-dataos.app:6432).
    • Database: Specify the database name (e.g., lens:public:productaffinity).
    • Authentication: Select Basic authentication and enter the UserID and API Key (retrievable from the DataOS profile page).
    • General encryption: The encrypted connection should be set to 'Not encrypted'.

After filling out the required fields, click Add to create the connection.

  1. In the Settings screen, verify that the data gateway is running under the configured name (e.g., productaffinity-testing). Click Apply.

    DPH

  2. Click the public_productaffinity report icon to confirm the connection is active.

    DPH

Supported data types

Category Data Types Support Status
Dimension timestringnumberboolean Supported
Measure maxminnumbersumcountbooleanstringtimeavgcount_distinct Supported
Measure count_distinct_approx Not Supported
Rolling Window - Not Supported (Power BI doesn’t support)

Important considerations

  • In Power BI, measures typically have an 'm_' prefix to indicate they represent a measure. For example, a measure calculating total revenue might be named m_total_revenue.
  • The connection is live, meaning any changes to the underlying data will be reflected in Power BI.
  • When schema changes occur, such as CRUD operations (Create, Read, Update, Delete) on dimensions, measures, or other elements of the semantic model, a re-sync is required. To prevent losing previously created reports after the re-sync, download the model folder from the Data Product Hub, extract the contents, and replace the existing folder with the new one.

Best practices

Adhering to best practices ensures that you effectively utilize the Data Product Hub and maintain compatibility with the latest features and updates. Following these guidelines will help optimize workflow, enhance performance, and prevent potential issues.

File handling

Ensure that .pbip folders are fully extracted before opening them. Failure to do so may result in missing file errors, as shown below:

DPH

Data retrieval and field selection considerations

It is important to select fields from tables that are directly related or logically joined, as the system does not automatically identify relationships between tables through transitive joins. Selecting fields from unrelated tables may result in incorrect or incomplete results.

Troubleshooting

Connection reset

If you encounter a 'connection reset' error during Power BI sync as shown below:

DPH

  • Go to the Home tab in Power BI Desktop.
  • Click the Refresh button in the Queries section.

DPH

This should resolve the error and restore the sync.

Unknown cluster

Whenever you encounter the error 'unknown cluster: ' as shown below, please check if the cluster has been deleted. If it has, redeploy the cluster. After redeploying the cluster, go to Power BI Desktop and click the 'Refresh' button to update the connection.

DPH

Limitations

  • Power BI fails to handle special characters (e.g.,) when generating queries through the synced semantic model, causing errors in visualizations. Thus, it is best practice to address or remove special characters directly in the data itself.
  • Power BI's Direct Query mode does not support creating custom dimensions and measures or querying the rolling window measure due to the lack of date hierarchy.
  • DAX functions and Import query mode are not supported.

Governance of model on Power BI Service

Data masking policies are enforced based on the user who creates and registers the gateway connection for the semantic model in PowerBI Service.

Was this page helpful?