user1002771
user1002771

Reputation: 29

Dax to Calculate the Date difference from Due date

enter image description here

I wrote below Dax to calculate the date difference between due date and todays dates. Aim is flag tasks which were missed and still not completed. i get this weird date in 1899. I have checked data types and its set to date format but still not actual date difference.

duein = DATEDIFF(TODAY(),Task[TaskDueDate].[Date],DAY)

Upvotes: 0

Views: 583

Answers (1)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60474

The problem is your formatting of the duein column. You have it formatted as a date. The numeric equivalent of 19/12/1899 is -11, which is the days difference you are looking for.

In general, MS programs store dates as the number of days difference from 31/12/1899.

Change the formatting of duein to number, and you should show the result you are looking for.

Upvotes: 4

Related Questions