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
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
Employee
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
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.

Top Solution Authors