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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Jig_S
Frequent Visitor

Strange behavior using R script in Query and Date Values

Hello,

 

I ran into a strange behavior when trying to use the newly introduced R script support in Query mode and date values. 

 

We performed a cumulative sum on some values related to time-series and when we generated the output (output <- dataset) after calculating the required values, we found that on expanding the output table, the Date values are transformed to Microsoft.OLEDB.Date. 

We managed to circumvent by converting the date values to text prior to executing the R script and converting back to Date once the R script was successfully executed. 

Just wanted to share the behavior and ask if anyone else encountered a similar output while dealing with dates in R script.

 

Best Regards,

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft Employee
Microsoft Employee

@Jig_S

 

I’ve also reproduced this problem locally and reported it internally. I’ll update here if there is some feedback.

For now, you can use the workaround you’ve found.

 

Best Regards,

Herbert

View solution in original post

4 REPLIES 4
qshngv
Frequent Visitor

I'm having the same issue. Is there any updates on this bug?

 

I have also tried jb1t's script but still have all dates exported as Microsoft.OLEDB.Date.

@qshngv

 

This is a known limitation that is not going to be fixed any time soon. The workaround is to convert the date time to a primitive type (e.g. string) before sending it to into R and then convert it back in resulting table.

 

Best Regards,

Herbert

jb1t
Advocate I
Advocate I

I'm seeing a similar issue. It seems that the data frame automatically created for a query (dataset) is has the setting stringsAsFactors = TRUE, so I had to do the following:


output <- as.data.frame(dataset, stringsAsFactors = FALSE)

 

v-haibl-msft
Microsoft Employee
Microsoft Employee

@Jig_S

 

I’ve also reproduced this problem locally and reported it internally. I’ll update here if there is some feedback.

For now, you can use the workaround you’ve found.

 

Best Regards,

Herbert

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

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.

Top Solution Authors