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
Oussov
Frequent Visitor

Export filtered dataset programmatically?

Hi,

 

Suppose I use PowerBI service or embedded and want to send table visual rows to some other web service. How can I do it?  I was considering custom R-script or visual, but the network is blocked in the service.  With PowerBI embedded, there is no API function for this, I can only get a list of applied filters. And apparently I cannot directly access the report iframe by javascript.  Are there any workarounds or is it fundamental limitation?

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Oussov wrote:

Hi,

 

Suppose I use PowerBI service or embedded and want to send table visual rows to some other web service. How can I do it?  I was considering custom R-script or visual, but the network is blocked in the service.  With PowerBI embedded, there is no API function for this, I can only get a list of applied filters. And apparently I cannot directly access the report iframe by javascript.  Are there any workarounds or is it fundamental limitation?


When embedding Power BI reports with PowerBI Javascript API, There's an event called "dataSelected", It can capture the seleced data. eg, when clicking on a histogram, the selected data gets captured.

 

However, when clicking on a table visual, there no such event triggered. A workaround I can think of is using a column chart that shows the same data in your table visual.

 

This  PowerBI Javascript API can be applied to embed reports from both Power BI Service and Power BI Embedded.

 

Capture.PNG

 

<html>

  <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>

<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>
     

<script type="text/javascript">
window.onload = function () {
 
var embedConfiguration = {
    type: 'report',
    accessToken: 'yourToken',
    id: 'yourReportID',
    embedUrl: 'https://app.powerbi.com/reportEmbed'	 
}; 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

 var reportPages; 
  

report.on('dataSelected', function(event)
{
var data = event.detail;
		 
         console.log(JSON.stringify(data, null, ' '));
		 
});
 ;
 

}
</script>

<div  id="reportContainer"></div>
</html>

 

Hello, We want to export data for specific tile from report via Javacsript api. Le us know how to implement this. Thank you. 

Thank you very much for the idea.  However is not it so that the data captured event will show aggregated data used to visualize a column rather than the underlying table rows?

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.