Forum Discussion
Datediff calculation error with days or weeks
- 4 years ago
Hi pminnov ,
Not sure why it only didn't work on days and weeks, but according to the error message, it's always related to the DirectQuery mode when there're complex data model or complex DAX. According to this blog, I guess it might be because when you use days and weeks in DAX, DAX query generated by the visuals on your report has not be folded into queries against your data source.
Additionally, you can also take a look at the discussions in the thread:
OLE DB or ODBC error: [Expression.Error] We couldn... - Microsoft Power BI Community
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pminnov ,
According to the error message, by my research, I guess it's related to the DirectQuery mode, please try to use the import mode to check.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- pminnov4 years ago
Helper II
The expression does work however if months or years is used as the interval (just not weeks or days). The expression did work when I did a table merge then created a new column in the merged table and calculated the number of days between the two dates per row. I'm just confused as to why days or weeks was resulting in an error.
- v-yanjiang-msft4 years ago
Community Support
Hi pminnov ,
Not sure why it only didn't work on days and weeks, but according to the error message, it's always related to the DirectQuery mode when there're complex data model or complex DAX. According to this blog, I guess it might be because when you use days and weeks in DAX, DAX query generated by the visuals on your report has not be folded into queries against your data source.
Additionally, you can also take a look at the discussions in the thread:
OLE DB or ODBC error: [Expression.Error] We couldn... - Microsoft Power BI Community
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.