<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Power bi embedded dashboard problem in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-embedded-dashboard-problem/m-p/435471#M13422</link>
    <description>&lt;P&gt;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?&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2018-06-08 11.37.29.png" style="width: 507px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/100089i6D9BE39AD23DDEDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2018-06-08 11.37.29.png" alt="Screenshot 2018-06-08 11.37.29.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 09:38:33 GMT</pubDate>
    <dc:creator>Rei</dc:creator>
    <dc:date>2018-06-08T09:38:33Z</dc:date>
    <item>
      <title>Power bi embedded dashboard problem</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-embedded-dashboard-problem/m-p/434710#M13400</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/a6516b0635230910668e10ed882822029d7c6438/68747470733a2f2f696d6167652e6962622e636f2f666d304538542f53637265656e73686f745f323031385f30365f30375f31335f35325f31392e706e67" border="0" alt="" width="531" height="274" /&gt;&lt;/P&gt;&lt;P&gt;Additionally, the console returns&amp;nbsp;three errors:&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P&gt;The dashboard works ok in the app:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/258a660ffaf07b775677df59f31d8b80f21acbd3/68747470733a2f2f696d6167652e6962622e636f2f6a796330686f2f53637265656e73686f745f323031385f30365f30375f31335f34305f35372e706e67" border="0" width="541" height="325" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/700e9d38f37177602bb7c9f04cd7038f11c9d8e4/68747470733a2f2f707265766965772e6962622e636f2f634d4446686f2f53637265656e73686f745f323031385f30365f30375f31335f35375f34372e706e67" border="0" alt="" width="646" height="335" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code that I'm using to get an access token:&lt;/P&gt;&lt;PRE&gt;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);
      });
    });
  }&lt;/PRE&gt;&lt;P&gt;And here's the code that I'm using to get the embed token:&lt;/P&gt;&lt;PRE&gt;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);
      });
    });
  }&lt;/PRE&gt;&lt;P&gt;I've tried to paste my data into the demo page (&lt;A title="" href="https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html&lt;/A&gt;) and it worked well for some time there, but after&amp;nbsp;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://docs.microsoft.com/en-us/power-bi/sample-financial-download" target="_blank" rel="nofollow noopener noreferrer"&gt;financial sample&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as my data source just to test the embed functionality (if that means anything). Please help&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;IMG src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-sad.png" border="0" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:30:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-bi-embedded-dashboard-problem/m-p/434710#M13400</guid>
      <dc:creator>Rei</dc:creator>
      <dc:date>2018-06-07T13:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi embedded dashboard problem</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-embedded-dashboard-problem/m-p/435471#M13422</link>
      <description>&lt;P&gt;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?&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2018-06-08 11.37.29.png" style="width: 507px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/100089i6D9BE39AD23DDEDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2018-06-08 11.37.29.png" alt="Screenshot 2018-06-08 11.37.29.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 09:38:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-bi-embedded-dashboard-problem/m-p/435471#M13422</guid>
      <dc:creator>Rei</dc:creator>
      <dc:date>2018-06-08T09:38:33Z</dc:date>
    </item>
  </channel>
</rss>

