Forum Discussion
DateDiff with Direct Query as Measure
I need to have the Date Difference between two Date columns
I'm using the DateDiff Function but it gives me the following error message:
Query(1,1) Function 'DATEDIFF' is not allowed as part of calculated column DAX expressions on Direct Query models
Can I use it as measure, I know i need to filter the Results somehow by row.
Any help is appreciated
6 Replies
- luke611Frequent Visitor
I have exactly the same. DirectQuery + Oracle database. Any ideas?
- lbendlinSuper User
DATEDIFF is overrated. Try just subtracting one date from the other. Internally dates are treated as numbers with the whole part representing the days and the fraction representing, well fractions of days. Say you want to know the difference between Date A and Date B in hours, you would write ([Date A]-[Date B])*24
- AnonymousNot applicable
HI MarionKeller ,
You can have a look at this blog
https://community.powerbi.com/t5/Desktop/DATEDIFF-in-Direct-Query-Mode-32-bit/m-p/492878
Regards,
Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)