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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With