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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Lebunim
Regular Visitor

Export to excel or csv using R script with Specific format

Hi all,

I have created a report and I need to export certain part after analysis aplied. I created an R Script which run each time I refresh the data. I'm pretty happy with the end result, but I would like to improve format of the export. 

 

In my export I get Sequence (not needed), UserName (Needed), Date (bad format).

 

Script: 

# dataset <- data.frame(UserPrincipalName, Latest Usage, License Type, License Owner)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(utils)
write.csv (dataset, file ="D:/Licenses/TelecomUserLicenseUsage.csv");
 
Can someone help me modify script to remove sequence column which is added automatically by R Script and change the date to this format - YYYY-MM-DD
 
Many thanks in adavance

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Please try:

1. Convert all date columns to "Whole Number." 

2. Run the R scriptChange the datatype back to date once the script has provided an output.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Please try:

1. Convert all date columns to "Whole Number." 

2. Run the R scriptChange the datatype back to date once the script has provided an output.

mahoneypat
Microsoft Employee
Microsoft Employee

Have you considered using a Paginateed Report to export your data?  Or the new Power Automate visual, so you get just the fields you want, and then create file, email it or store on SharePoint, etc.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.