Forum Discussion
DAX: Date Difference required with New Measure
- Anonymous8 years ago
Daydiff = VAR Created = MAX ( 'Dates'[CreatedDt] ) VAR Closed = MAX ( 'Dates'[ClosedDt] ) VAR NoOfDays = IF ( Closed > Created, DATEDIFF ( Created, Closed, DAY ), DATEDIFF ( Closed, Created, DAY ) ) RETURN IF ( NoOfDays >= 21, "Met SLA", "NotMet SLA" )Just created another variable called NoOfDays with the calculation you wanted, then use it in the other if statement
- Anonymous7 years ago
ssvr, this should do it
DDiff_DueDateCloDate = VAR Due = INT( MAX ( 'Task'[DueDate] ) ) VAR Clos = INT( MAX ( 'Task'[ClosedDate] ) ) RETURN Due - Clos
INT() will convert a date into an integer.
Then you simply subtract one number from the other. This will make the result show a negative number, and should be the fastest performance-wise.
Anonymous Thanks
No filters applied
Might be some DAX error
If you get any accurate DAX please share with me
Anonymous
I posted this requirement on few days back no one replied
Please look into it if you have time
Day Diffarence excluding weekends
I created a Date table:
Dim Table=CALENDAR(DATE(2008,1,1),DATE(2018,12,31))
I created a new column with is working day or not
is work day = SWITCH(WEEKDAY([Date]),1,0,7,0,1)
Now I want to create "DateDifference" Column with Createddate & Closeddate (I want to know day diffarence b/w these two dates excluding weekends)
CreatedDate ClosedDate DateDiffarence
- Anonymous8 years agoNot applicable
send me the link to that thread. That way others can search for the thread and see the solution