Requirement:
Take difference between two data values.
Example:
EndDate: 11/20/2013
StartDate: 11/14/2013
DateDifference: 6
Let’s start writing some DAX!
Ok, seems simple, right? Try creating a measure DateDifference:=[EndDate]-[StartDate]
Did that work? NO? Does it return date?
Don’t worry, Here’s the solution. Try creating following DAX Measure:
[code language=”sql”]
DateDifference:=1.0*([EndDate]-[StartDate])
[/code]
That’s about it for this post. Here are some related Posts:
Calculate the difference between two dates in DAX
Q: How can I calculate difference between two dates in DAX (seconds, minutes, hours, days and months)
NETWORKDAYS() Equivalent in PowerPivot?
when we add one criteria this formula do not works