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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
iskakovshamil
Frequent Visitor

Get visual from report Power BI Embedded

Hello, guys. 

Can i get only one visual from report? I can get whole report and embed in to app, it's ok, but what about each visual on this report? Can I customize the page so that I insert certain widgets in certain places? Is it possible to somehow compose a page by inserting not a complete report, but a separate widget?

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @iskakovshamil ,

 

Here is an offical blog covers the steps for embedding a visual in your application.

For reference: Embed a report visual

Example code:

// Set up the configuration object that determines what to embed and how to embed it.
let embedConfiguration = {
    accessToken: anAccessToken,
    embedUrl: anEmbedUrl,
    id: aReportId,
    pageName: aPageName,
    tokenType: aTokenType,
    type: 'visual',
    visualName: aVisualName
};
 
// Get a reference to the HTML element that contains the embedded report.
let embedContainer = $('#embedContainer')[0];
 
// Embed the visual.
let visual = powerbi.embed(embedContainer, embedConfiguration);

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
jorritdejager84
New Member

Anyone experience with doing this in C#?

v-rzhou-msft
Community Support
Community Support

Hi @iskakovshamil ,

 

Here is an offical blog covers the steps for embedding a visual in your application.

For reference: Embed a report visual

Example code:

// Set up the configuration object that determines what to embed and how to embed it.
let embedConfiguration = {
    accessToken: anAccessToken,
    embedUrl: anEmbedUrl,
    id: aReportId,
    pageName: aPageName,
    tokenType: aTokenType,
    type: 'visual',
    visualName: aVisualName
};
 
// Get a reference to the HTML element that contains the embedded report.
let embedContainer = $('#embedContainer')[0];
 
// Embed the visual.
let visual = powerbi.embed(embedContainer, embedConfiguration);

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.