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.
I have a dataframe which holds a column with date values. The datatype for this column is date in Power BI. When I try to modify this dataset in R script and put a filter on the date column, I am getting the below error which looks like it is being returned from ADO.NET. I am able to do the conversion just fine in native R. Any idea what is going wrong here? I tried to convert this column into datetime and use as.Date(<columnName>) > Sys.Date()-1 as well. But nothing seems to work,
Here is the line of code which is throwing this error:
subData <- subset(dataset, as.Date(ProcuredOn) > Sys.Date()-1)
Solved! Go to Solution.
I managed to get that filter working by reloading the dataset and configuring the intermediate steps again from scratch. Strange though. The error message that I got earlier said something like "Invalid data conversion". I guess it was something related to some other column which got it's type changed in between the steps.
Hi @karun_r,
@karun_r wrote:
I have a dataframe which holds a column with date values. The datatype for this column is date in Power BI. When I try to modify this dataset in R script and put a filter on the date column, I am getting the below error which looks like it is being returned from ADO.NET.
What's the error message? I haven't found it in your post above.
I have tested the R script shared above on my Power BI Desktop(Version: 2.50.4859.502 64-bit (September 2017)). It seems to work for me without any issue.
Could you share a sample pbix with just some sample/mock data which can reproduce the issue.? So that we can help further investigate on it. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.
Regards
I managed to get that filter working by reloading the dataset and configuring the intermediate steps again from scratch. Strange though. The error message that I got earlier said something like "Invalid data conversion". I guess it was something related to some other column which got it's type changed in between the steps.
Hi @karun_r,
Great to hear the problem got resolved! Could you accept your last reply above as solution to close this thread?
Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |