Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Trying to get number of days between 2 dates - have done multiple different options and DATEDIFF is giving me these errors:
"The third argument Interval can only be one of the following: YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND."
Previously it was giving me this error:
"The syntax for 'TODAY' is incorrect. (DAX(Datediff([sys_created_on].[Day]TODAY()))).
OR most frequently
Too few arguments were passed to the DATEDIFF function. The minimum argument count for the function is 3."
Each time I try to include DATEDIFF option - current one is
Solved! Go to Solution.
Hi @bsaldri1028 ,
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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @bsaldri1028 ,
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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
84 | |
78 | |
70 | |
46 | |
42 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
40 |