I have to export all data from PowerBI visuals.
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) uses a lazy load to load all the entries, when I export the data - it only exports 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 programmatically at once?