Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Power BI Integration

Security covered Under active development 94 sites

This project provides tools to integrate Power BI into Drupal, enabling access to Power BI's embed and RestAPI. It allows for embedding Power BI reports and dashboards within Drupal content.

Power BI

Provides tools to integrate Power BI into Drupal

What is it for?

These modules provide the tools to integrate Power BI into Drupal, with
the different modules you will be able to access the embed and RestAPI of PowerBi.
This is the process workflow and the role of each of the modules in it:

Dependencies

PowerBi Embed needs the PowerBi client from https://github.com/microsoft/PowerBI-JavaScript. There are three options to install it.

Preferred method:

PowerBi Embed provides a package.json to include the powerbi-client library. Make sure you have NPM of nodejs installed in your system and from the module folder, run `npm install`.

Alternatively, in your composer add the following script in your post-install-cmd scripts in order to install the
dependencies with each `composer install`.

{
  "scripts": {
    "post-install-cmd": [
      "npm install -C [path to module]"
    ]
  }

In the script above, it is assumed that the `pwbi` module is installed in the `web/modules/contrib` directory as
a relative path from the project root or where your `composer.json` is located. Adapt the path according to your installation.

Composer
You can use composer to download the powerbi js client by taking these steps:

1. Run the following command to ensure that you have the "composer/installers"
package installed:

composer require --prefer-dist composer/installers

2. Add the following to the "installer-paths" section of "composer.json":

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

3. Add the following to the "repositories" section of "composer.json":

 {
       "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"
           }
       }
   }

4. Run the following command; you should find that new directories have been
created under "/libraries".

composer require --prefer-dist microsoft/powerbi

Alternative methods:

Manually download and install the library, from https://github.com/microsoft/PowerBI-JavaScript, in the `libraries` folder in the webroot, profile directory or site directory
within drupal. The package should be placed as such, so that the path looks like
`
/powerbi/dist/powerbi.min.js` where `
` is one of the directories mentioned above.

Usage

Power BI Authentication

1. Give permissions to configure the module (Administer Power BI configuration).
2. Configure access credentials: admin/config/pwbi/authentication_settings.
3. Include the service pwbi_authentication.authentication and use the method ::getAccessToken() to get the access token.
4. Use the access token on request to PowerBi Rest API.

Configure pwbi_embed

1. Configure available PowerBi workspaces: admin/config/pwbi/embed_settings
2. Create a Media Entity using the "PowerBi Embed" Media Type
3. Create Media content.

Customizing PowerBi embed

This module allows others to customize the js embedding process. This is achieved by
two events trigger before and after embedding:
1. PowerBiPreEmbed: This event is triggered before embedding the object and allows changing the configuration options,
using something like this:

    window.addEventListener("PowerBiPreEmbed",
        (e) => {
            const powerBiConfig = e.detail;
        }
    );

2. PowerBiPostEmbed: This event is triggered after embedding the object and allows changing the embedded object,
using something like this:

    window.addEventListener("PowerBiPostEmbed",
        (e) => {
        const powerBiReport = e.detail;
    }
);
Drupal 10–11

Ask your assistant about Power BI Integration

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
8
Tracked since
May 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 5
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.3 Stable 10–11 Mar 31, 2025
2.0.2 Stable 10–11 Mar 21, 2025
2.0.1 Stable 10–11 Mar 21, 2025
2.0.0 Stable 10–11 Mar 19, 2025
1.0.2 Stable 10–11 Dec 17, 2024
1.0.1 Stable 10 PHP 8.1 Aug 2, 2024
1.0.0 Stable 10 PHP 8.1 Jun 11, 2024
1.x-dev Dev 10–11 PHP 8.3 May 3, 2024