Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Embedding a PowerBI Report in a Confluence page

Aaron Williams March 27, 2024

Hello, having a tricky problem.

We use a connector for JSM to PowerBI to create a report, and we have the report set up with Embed Capacity and token authentication.

Reviewing PowerBI embed documentation: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embedded-analytics-power-bi

There is an option to embed a report where our client can view the report without personally authenticating. We've generated a token and amended the script found here to match our details: https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/embedding-solutions#embed-for-your-customers

Since the script is JavaScript, I found this Confluence KB article: How to use JavaScript in Confluence | Confluence | Atlassian Documentation

But now I'm a bit stuck - I'm not really a code guy, and this is beyond my technical abilities.

As I read it, I should insert the code directly in a script block like:

<iframe title="Title Here" width="1140" height="541.25" src="https://app.powerbi.com/reportEmbed?reportId=id-here" frameborder="0" allowFullScreen="true">
</iframe>

<script type="text/javascript">
let models = window['powerbi-client'].models;
let embedConfiguration = {
type: 'report',
id: 'id here',
embedUrl: 'https://app.powerbi.com/reportEmbed',
tokenType: models.TokenType.Embed,
accessToken: 'token here' };
var $dashboardContainer = $('#embedContainer');
var dashboard = powerbi.embed($dashboardContainer.get(0), embedConfiguration);
</script>

I'm not sure where I'm going wrong here, I literally don't have the first clue - does the iframe block need to be inside the script, does the script need to be inside the iframe block, do I need to include something with the JQuery stuff, I just don't know - any advice appreciated.

This is on Confluence Server so I don't have the option of buying an add-on to solve this, nor do I have the option of buying an add-on to replace PowerBI.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events