Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
J_4923
Frequent Visitor

Exporting data using R

Hi,
I’m trying to export data from Power BI using R. I’ve tried to follow http://www.thebiccountant.com/2015/12/28/how-to-export-data-from-power-bi-and-power-query/

However I’m getting an error message:

 

Capture.JPG

 


 
The steps that I’ve used:
1. Create new report (page1)
2. Choosing two columns (BLNumber, ChrgWeight) from table (PS_total)
 test.png
3. Applying R script visual

test2.png
 
4. Getting the R script editor

test3.png
 
5. Pasting this code: write.table(trim(dataset), file=”Libraries/Documents/R-test.txt”, sep = “\t”, row.names = FALSE);


6. When pressing the Run script, I’m getting the Error message and file R-test.txt is still blank

 

Can anyone please help me?
Thanks

4 REPLIES 4
v-sihou-msft
Employee
Employee

@J_4923

 

As I tested, you need to grant the permisson for "ALL APPLICATION PACKAGES" and "ALL RESTRICTED APPLICATION PACKAGES" on that text file security.

 

89.PNG

 

Then that R script should work.

 

require(gdata)
write.table(trim(dataset), file="/Program Files/R/R-3.3.3/1.txt", sep = "\t", row.names = FALSE)
plot(dataset);

 

 

 

78.PNG

 

88.PNG

 

Regards,

Hi,

@v-sihou-msft

This works fine for smaller set of data, however when trying to export a bigger data set I'm getting the following error:

 

Capture.JPG

 

Any idea on how to work around this?

@J_4923

 

If you just need to export dataset to a file, you can try to use "Export Data" feature on Power BI Service: Export data from Power BI visualizations

 

Regards,

Hi,

 

@v-sihou-msft yes, but I would like to try exporting the data as automated as possible i.e. as little hands on as possbile. So idea was to schedule a report refresh doing this automated.

 

Are there any limitations exporting the data as you describe?

 

Best Regards

J

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.