Forum Discussion
PBI5851
5 years agoHelper V
DateDiff with Filter based on specific value
Hello, I am trying to capture the number of accounts and how long have they been in a specific status. Since we cant use a filter within datediff , not sure how to achieve this. AccountID Sta...
- Anonymous5 years ago
Hello @PBI5851
1)
DaysSinceDelivered = var _DelDate = CALCULATE(max(Table2[StatusDate]), FILTER(ALLEXCEPT(Table2,Table2[AccountID]),Table2[CurrentFlag] = "1" && Table2[Status] = "Ship" && Table2[Substatus] = "Delivered")) Return DATEDIFF(_DelDate,TODAY(),DAY)2)
Delivered Morethan10Days = CALCULATE(COUNTROWS(Table2), FILTER(ALLEXCEPT(Table2,Table2[AccountID]),Table2[CurrentFlag] = "1" && Table2[Status] = "Ship" && Table2[Substatus] = "Delivered" && DATEDIFF(Table2[StatusDate],TODAY(),DAY)>10))
Anonymous
5 years agoNot applicable
Hello @PBI5851
1)
DaysSinceDelivered =
var _DelDate = CALCULATE(max(Table2[StatusDate]), FILTER(ALLEXCEPT(Table2,Table2[AccountID]),Table2[CurrentFlag] = "1" && Table2[Status] = "Ship" && Table2[Substatus] = "Delivered"))
Return DATEDIFF(_DelDate,TODAY(),DAY)
2)
Delivered Morethan10Days =
CALCULATE(COUNTROWS(Table2), FILTER(ALLEXCEPT(Table2,Table2[AccountID]),Table2[CurrentFlag] = "1" && Table2[Status] = "Ship" && Table2[Substatus] = "Delivered" && DATEDIFF(Table2[StatusDate],TODAY(),DAY)>10))