Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting all data programically from powerBI Visual

Tags:

I have to export all data from PowerBI visual.

I managed to use a library powerbi.js (https://github.com/Microsoft/PowerBI-JavaScript/wiki/Export-Data) and manage to implement the following solution:

report.page("ReportSection").getVisuals()
   .then(function(visuals) {
        return visuals.find(function (visual) { return visual.name === "829c5bdfe33aba301b32" });
    }).then(function(emailVisual) {
        return emailVisual.exportData(models.ExportDataType.Summarized)
    }).then(function(result) { 
        console.log(result.data.length)
    });

However, because the visual (which is a table) use lazy load to load all the enries, when I export the data - it only export records, that are currently loaded into the visual.

To load more data, I need to scroll down the table, and call the above code again.

Is there a solution to export all data programmically at once?

like image 682
Marek Avatar asked Apr 19 '18 09:04

Marek


1 Answers

Try using modifying your code to

return emailVisual.exportData(models.ExportDataType.Underlying)

This should give you all the data and not just what is shown in the visual at that instant

like image 167
RBreuer Avatar answered Oct 13 '22 11:10

RBreuer