Forum Discussion
Datediff
- 6 years ago
Hi Anonymous ,
Assuming you are making a calculated column your syntax needs to be the following:
Column = DATEDIFF(Table[sys_created_on].[Day]; TODAY();DAY)Regarding the errors you are having is refering to the fact that you don't have the third parameter on the DATEDIFF function on the option above the calculation is made in days however if you make that parameter in any of those refered (YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND) the result will be accordingly to that.
Another thing is date you are placing the .[day] when refering to your column that will give you a calculation based on the day of the date and not the all date giving you and unexpected result.
If you are refering to a measure your syntax need to be similar to this:
Measure = DATEDIFF(SELECTEDVALUE('Table'[sys_created_on]); TODAY(); DAY)Regards,
MFelix
Hi Anonymous ,
Assuming you are making a calculated column your syntax needs to be the following:
Column = DATEDIFF(Table[sys_created_on].[Day]; TODAY();DAY)
Regarding the errors you are having is refering to the fact that you don't have the third parameter on the DATEDIFF function on the option above the calculation is made in days however if you make that parameter in any of those refered (YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND) the result will be accordingly to that.
Another thing is date you are placing the .[day] when refering to your column that will give you a calculation based on the day of the date and not the all date giving you and unexpected result.
If you are refering to a measure your syntax need to be similar to this:
Measure = DATEDIFF(SELECTEDVALUE('Table'[sys_created_on]); TODAY(); DAY)
Regards,
MFelix