Forum Discussion
Anonymous
6 years agoNot applicable
Date Difference issue
Hello - I am having a hard time getting the right result. First, I do have a date table. Second, I am not using the DATEDIFF formula as I've tried using it but it does not allow for if the s...
Anonymous
6 years agoNot applicable
Anonymous I guess you are not using datediffmeasure in R Channel OnTime or Late calculation. try using date diff measure
AR Channel OnTime or Late = if(Date Difference Measure <=3, "On Time","Late")
Or else here is another approach
1. Create a weekday column in date table
Weekday = WEEKDAY('Calendar'[Date],2)
2. Finally create a measure
Measure =
VAR _due = SELECTEDVALUE('Table'[Due Date])
VAR _shipped = SELECTEDVALUE('Table'[Date Shipped])
VAR _datediff = CALCULATE(COUNTROWS('Calendar'),FILTER('Calendar','Calendar'[Date]>=_due&&'Calendar'[Date]<=_shipped&&'Calendar'[Weekday]<6))
RETURN IF(_datediff<=3,"On Time","late")Anonymous
6 years agoNot applicable
Anonymous - Hi Vimal - The measure works but the one problem I have with it is that it ignores any filter context I have.
For example, if I apply your measure to my table visual, it does not cross filter when I use my chart visual to filter by month. You can see the difference here.