Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 102 | |
| 67 | |
| 65 | |
| 56 |