Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Rei
Regular Visitor

Power bi embedded dashboard problem

Hello,

I'm trying to embed a dashboard into my webpage (using node.js). The dashboard loads all of the tiles that are included in it, but all of them are just empty (you can see only the titles), the dashboard also does not have the visual styles I gave it in the power bi app:

Additionally, the console returns three errors:

GET https://wabi-west-europe-redirect.analysis.windows.net/powerbi/metadata/dashboards/2300798 
401 (Unauthorized)

https://wabi-west-europe-redirect.analysis.windows.net/metadata/ResourcePackages/22550273/a5be8563-8e2c-41ea-9a39-f251b716be9fA68hTmGOoPlC0.M1Yb1aGFsQmj0ptI-DM0FpLfamJ4c=-73971b02301c568dc2a0 
401 (Unauthorized)

powerbiportal.dependencies.externals.bundle.min.js:134 TypeError: Cannot read property 'name' of undefined

The dashboard works ok in the app:

 

I also can retrieve and embed a report using the same method that I'm using when trying to embed a dashboard and it works just fine:

 

Here's the code that I'm using to get an access token:

getAccessToken() {

    return new Promise(function (resolve, reject) {
  
      const url = 'https://login.microsoftonline.com/common/oauth2/token';
  
      const username = {username};
      const password = {password};
      const clientId = {clientid};
      const client_secret = {clientsecret};
      const headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
      };
  
      const formData = {
        grant_type: 'password',
        client_id: clientId,
        client_secret,
        resource: 'https://analysis.windows.net/powerbi/api',
        scope: 'openid',
        username,
        password,
      };
      
      request.post({
        url,
        form: serialize(formData),
        headers,
  
      }, function (err, result, body) {
        if (err) {
          return reject(err);
        }
        const bodyObj = JSON.parse(body);
        resolve(bodyObj.access_token);
      });
    });
  }

And here's the code that I'm using to get the embed token:

getEmbedToken(accessToken, groupId, itemCategory, itemId) {
    return new Promise(function (resolve, reject) {
  
      const url = `https://api.powerbi.com/v1.0/myorg/groups/${groupId}/${itemCategory}/${itemId}/GenerateToken`;
      
      const headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
        Authorization: `Bearer ${accessToken}`,
      };
  
      const formData = {
        accessLevel: 'View',
      };
      
      request.post({
        url,
        form: serialize(formData),
        headers,
  
      }, function (err, result, body) {
        if (err) { 
          return reject(err);
        }
  
        const bodyObj = JSON.parse(body);
        resolve(bodyObj.token);
      });
    });
  }

I've tried to paste my data into the demo page (https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html) and it worked well for some time there, but after visiting the demo page again a day after, the demo page also could not display the tiles properly. The tiles would also work OK for a couple of minutes after a series of refreshing the site, but after some more refreshes it would get back to the no-content-tiles state. I'm using the financial sample as my data source just to test the embed functionality (if that means anything). Please help Smiley Sad

1 REPLY 1
Rei
Regular Visitor

Okay, so I figured out that the problem was a custom template which I chose for my dashboard in power bi service. A plain dashboard with the light template works fine. Any ideas why a custom theme (I only changed the background color) would break the embedded dashboard? Screenshot 2018-06-08 11.37.29.png

 

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors