How To Integrate Power BI With Drupal? ⋆ Appic Softwares

How To Integrate Power BI With Drupal?

Power BI is becoming an essential part of a business due to its strong analytics features. It enables the business to gather information and make business-related decisions. If you have a Drupal website and are looking for ways to integrate Drupal with Power BI then you are at the right place. 

Here we will be informing you of the process that will help you to easily integrate Power BI with Drupal. So, let’s have a look at the content of this post-

What Is Power BI?

Power BI is a business analytics service and data visualization tool developed by Microsoft. It allows users to connect to various data sources, transform and clean the data, and create interactive, visually appealing reports and dashboards. Power BI is designed to help organizations make data-driven decisions by providing insights into their data.

Power BI Tools For Drupal Integration

With the help of the various modules, you can access PowerBi’s embed and RestAPI. These modules offer the means to integrate PowerBi into Drupal.

The process workflow and each module’s function are as follows:

Drupal with PowerBI
Source: https://www.drupal.org/project/pwbi

Three modules offer the following functionality:

  1. pwbi_authentication: offers PowerBi with authentication
  2. The PowerBi RestAPI is accessible through the pwbi_api service.
  3. pwbi_embed: this function offers a Media Type for embedding.

Dependencies

The PowerBi client from GitHub is required for PowerBi Embed. Three methods can be used to install it.

1st Method

A bundle is provided by PowerBi Embed.using json, the powerbi-client library is included. Make sure nodejs’ NPM is installed on your machine, then type “npm install” in the module folder.

If you like, you may install the dependencies with each ‘composer install’ by adding the following script to your post-install-cmd scripts in composer.

{

  “scripts”: {

    “post-install-cmd”: [

      “npm install -C web/modules/contrib/pwbi/pwbi_embed”

    ]

  }

The ‘pwbi’ module is presumed to be installed in the ‘web/modules/contrib’ directory as a relative path from the project root or where your ‘composer.json’ is stored in the aforementioned script. The path should be modified to fit your system.

2nd Method

By following these steps, you may utilize Composer to download the powerbi js client:

  1. To confirm that you have the “composer/installers” package installed, use the following command:

composer require –prefer-dist composer/installers

The following should be added to “composer.json”‘s “installer-paths” section:

“libraries/{$name}”: [“type:drupal-library”],

The following should be added to “composer.json”‘s “repositories” section:

{

       “type”: “package”,

       “package”: {

           “name”: “microsoft/powerbi”,

           “version”: “2.1.19”,

           “type”: “drupal-library”,

           “dist”: {

               “url”: “https://github.com/microsoft/PowerBI-JavaScript/archive/refs/tags/v2.19.1.zip”,

               “type”: “zip”

           }

       }

   }

Run the following command, and you should see new directories under “/libraries” generated.

composer require –prefer-dist Microsoft/powerbi

3rd Method

Install the library manually in the ‘libraries’ folder of Drupal’s webroot, profile directory, or site directory by downloading it from GitHub. The package must be installed in such a way that the path reads “/powerbi/dist/powerbi.min.js” and ” is one of the folders listed above.

Usage Of Power BI With Drupal

Integrating Power BI with Drupal, a popular content management system (CMS), can be a powerful combination for creating data-driven websites or web applications. Here are some common use cases and steps for using Power BI with Drupal:

Embedding Power BI Reports/Dashboards in Drupal:

Step 1: Create a Power BI Report: First, create the desired reports and dashboards in Power BI Desktop or the Power BI Service.

Step 2: Publish to Power BI Service: If you’re using Power BI Desktop, publish the report to the Power BI Service. In the Power BI Service, you can share the report and generate an embed code.

Step 3: Configure Embed Settings: Configure the embedding settings in Power BI to define how the report should be embedded in your Drupal site. You can set options such as filtering, page navigation, and interaction capabilities.

Step 4: Embed in Drupal: In your Drupal site, you can use custom code or a module (if available) to embed the Power BI report. Typically, you’ll use an <iframe> element with the embed code provided by Power BI.

Single Sign-On (SSO) Integration:

  • You can implement Single Sign-On (SSO) between Drupal and Power BI to ensure that users don’t need separate login credentials for both systems.
  • Drupal can be configured to authenticate users against your organization’s identity provider (e.g., Azure Active Directory), and then, when they access embedded Power BI content, they will be automatically authenticated.

Data Integration:

  • If your Drupal site stores data that you want to visualize in Power BI, you can set up data integration between Drupal and Power BI.
  • Use ETL (Extract, Transform, Load) processes or connectors to transfer data from Drupal’s database to Power BI’s data sources.
  • Consider using Power BI’s data gateway if your data is on-premises and needs to be securely accessed by Power BI.

Dynamic Filtering and Parameterization:

  • Drupal can pass dynamic parameters or filters to embed Power BI reports. For example, you can filter data based on the currently logged-in user, their location, or other contextual information from your Drupal site.
  • This can be achieved through URL parameters or JavaScript interaction between Drupal and Power BI.

Custom Development:

  • If you have specific requirements that cannot be achieved with standard embedding methods, you may need to develop custom modules or scripts in Drupal to interact with Power BI’s APIs.
  • The Power BI REST API can be used for programmatic interaction with Power BI content.

Monitoring and Security:

  • Monitor the usage of embedded Power BI reports in Drupal to ensure performance and security.
  • Implement proper access controls and permissions in both Drupal and Power BI to restrict who can view and interact with the reports.

Documentation and Training:

Provide documentation and training for Drupal content creators and report consumers on how to use and interact with embedded Power BI reports within the Drupal environment.

How To Customize Power BI Embedded?

Others can modify the js embedding process with this module. Two events that happen before and after embedding enable this:

  1. PowerBiPreEmbed: Before embedding the object, this event is triggered, allowing the configuration settings to be changed as follows:

window.addEventListener(“PowerBiPreEmbed”,

        (e) => {

            const powerBiConfig = e.detail;

        }

    );

After the item has been embedded, the PowerBiPostEmbed event is triggered, allowing the embedded object to be changed as shown in the following example:

window.addEventListener(“PowerBiPostEmbed”,

        (e) => {

        const powerBiReport = e.detail;

    }

);

Conclusion

Now, in the end, we hope that through this post you were able to know the best way to integrate Power BI with Drupal. However, if you are looking for a Drupal development company that can help you with the integration and maintenance, then you should check out Appic Softwares. 

We have an experienced team of Drupal developers who have previously managed and integrated Power BI and Drupal. 

Moreover, if can even hire dedicated Drupal developers and manage your software. So, what are you waiting for?

Contact Us Now!

Get Free Consultation Now!


    Contact Us

    Consult us today to develop your application.

      Get in touch with us


      Skype Whatsapp Gmail Phone