Skip to content

Tile Embed

somriar edited this page Jun 19, 2017 · 5 revisions

Power BI tiles can now be embedded into your own applications.

Embed using javascript

In order to embed a tile using javascript you will need to create an embed configuration and call powerbi.embed(). Tile embed configuration has the following options:

  • type - must be 'tile'
  • embedUrl - the embed url
  • id - the tile id
  • dashboardId - the id of the dashboard that contains the tile
  • accessToken - Embed Token which allows View permissions on the tile.
  • tokenType - specifies the type of the token, Aad or Embed. More details in Embed Token section.
  • height - the height of the tile. by default this will be the iframe height
  • width - the width of the tile. by default this will be the iframe width

Example code for embedding a tile:

<div id="tileContainer"></div>
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

var embedConfiguration = {
	type: 'tile',
	accessToken: 'H4sIAAAAAA...ATudIWLCCgAA',
	id: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
	embedUrl: 'https://embedded.powerbi.com/embed',
        dashboardId: '5dac7a4a-4452-46b3-99f6-a25915e0fe55',
        tokenType: models.TokenType.Embed
};
var $tileContainer = $('#tileContainer');
var tile = powerbi.embed($tileContainer.get(0), embedConfiguration);