Forum Discussion
lcasey
9 years agoPost Prodigy
DATEDIFF, TODAY doesnt work.
Hello, When using This formula: Offline = DATEDIFF(Max('hardware'[Last Count]),Today(),DAY) I get an error The start date cannot be greater than the end date. I should get a 0 when the two d...
- 9 years ago
TODAY( ) should not be a problem.
Try this Measure which should work!
If it works you have days in the [Last Count] column that are later than today!
Offline = SWITCH ( TRUE (), TODAY () < MAX ( 'hardware'[Last Count] ), -1 * DATEDIFF ( TODAY (), MAX ( 'hardware'[Last Count] ), DAY ), TODAY () > MAX ( 'hardware'[Last Count] ), DATEDIFF ( MAX ( 'hardware'[Last Count] ), TODAY (), DAY ), 0 )
Sean
9 years agoCommunity Champion
TODAY( ) should not be a problem.
Try this Measure which should work!
If it works you have days in the [Last Count] column that are later than today!
Offline =
SWITCH (
TRUE (),
TODAY () < MAX ( 'hardware'[Last Count] ), -1 * DATEDIFF ( TODAY (), MAX ( 'hardware'[Last Count] ), DAY ),
TODAY () > MAX ( 'hardware'[Last Count] ), DATEDIFF ( MAX ( 'hardware'[Last Count] ), TODAY (), DAY ),
0
)lcasey
9 years agoPost Prodigy
There are no dates past 11/18/2016 so I am not sure why datediff doesnt work