5

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?

Marek
  • 3,935
  • 10
  • 46
  • 70
  • I just found out that other visual (like card) use lazy loading as well – Marek Apr 20 '18 at 14:49
  • Wanted to share for other users that there seems to be a bug in report server and when embedding with the exportData function. Perhaps this general bug - which MSFT say will be fixed ~2 weeks - is affecting your work too. – emma Apr 26 '18 at 10:45
  • Could you be more specific and give a link on that bug? Is it related with data export? – Marek Apr 26 '18 at 22:06
  • This seems relevant but isn't the link I referenced in my comment (still searching for that): http://community.powerbi.com/t5/Report-Server/Export-Data-not-working-after-Power-BI-Report-Server-March-2018/td-p/383897 – emma Apr 30 '18 at 08:05
  • Possibly useful: http://community.powerbi.com/t5/Issues/Bug-in-March-2018-PBIRS-Releas-Export-Data-not-working/idi-p/381593 – emma Apr 30 '18 at 08:12

2 Answers2

3

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

RBreuer
  • 1,371
  • 1
  • 7
  • 17
  • I have already tried this and it was not working for me. Are u sure that "underlying" option is for this purpose? – Marek Apr 22 '18 at 19:50
1

Are you trying to export more than 30k rows? exportData API is limited to 30K rows (as described in https://github.com/Microsoft/PowerBI-JavaScript/wiki/Export-Data).

Ran
  • 59
  • 1
  • it doesn't matter - I have more than 100 000 records, but what get exported is only data visible on the table (about 5000 records), which is lazy loaded (when I scroll to the bottom of the table, more data is loaded). Exported data is the data that is visible in the table. Maybe there is an option to turn of lazy load of TableEx visual? – Marek Apr 24 '18 at 14:18