Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

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;
    }
);

Activity

Total releases
4
First release
Mar 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 4
Maintenance
Dormant

Release Timeline

Releases

Version Type Release date
2.0.3 Stable Mar 31, 2025
2.0.2 Stable Mar 21, 2025
2.0.1 Stable Mar 21, 2025
2.0.0 Stable Mar 19, 2025