Forum Discussion
EaglesTony
Post Prodigy
1 year agoHow can I get a datediff based off the next logical row ?
I have the following table: IssueKey Status FirstTransitionTo ABC Backlog 1/1/2024 ABC In Progress 1/15/20...
- 1 year ago
I could try this.
What I ended up doing was replicating the original table to other tables based off Status and then did a group by the IssueKey and seems to work.
Gabry
Super User
1 year agoCheck this out
DaysInStatus =
VAR CurrentDate = 'Tabella'[ FirstTransitionTo]
VAR NextDate =
CALCULATE(
MIN('Tabella'[ FirstTransitionTo]),
FILTER(
'Tabella',
'Tabella'[IssueKey ] = EARLIER('Tabella'[IssueKey ]) &&
'Tabella'[ FirstTransitionTo] > CurrentDate
)
)
RETURN
IF(
ISBLANK(NextDate),
DATEDIFF(CurrentDate, TODAY(), DAY),
DATEDIFF(CurrentDate, NextDate, DAY)
)