Forum Discussion
Days between two dates columns
There's also the DATEDIFF DAX function.
Days between = DATEDIFF([Transactiondate],[Closed],DAY)
- gkhare10 years agoFrequent Visitor
Not working for me! I' am trying to take no.of days between close_date and start_date, it throws an error which says-The third argument Interval can only be one of the following: YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND...
I' am using the following expression
DaysLenght = DATEDIFF(AA_SALES_FACT[CLOSE_DATE],(AA_SALES_FACT[START_DATE]),DAY())
Request all gurus to kindly help me in fixing the above. I need to take the difference between Close_Date and Create_Date
- HarrisMalik10 years agoContinued Contributor
gkhare there is a mistake in your formula the third argument to DATEDIFF is Interval not function. Use following formula:
DaysLenght = DATEDIFF(AA_SALES_FACT[CLOSE_DATE],AA_SALES_FACT[START_DATE],DAY)
- HarrisMalik10 years agoContinued Contributor
gkhare there is a mistake in your formula the third argument to DATEDIFF is Interval not function. Use following formula:
DaysLenght = DATEDIFF(AA_SALES_FACT[CLOSE_DATE],AA_SALES_FACT[START_DATE],DAY)
Edit: I do not know your data model just to be sure the first argument of DATEDIFF() is Start Date, second is End date and third is interval i.e. DAY, MONTH,YEAR etc
DATEDIFF(<start_date>, <end_date>, <interval>)
- WendyMc10 years agoNew Member
Thanks for posting - just what I was looking for