Forum Discussion
Mike22
7 years agoHelper III
Date difference between workflow actions on a table
Hello Community, I need your help please. I have the following table tracking the workflow actions for each document ID keeping track of the sequence number, who is pending action and the date ...
- 7 years ago
Hi Mike,
Please download the demo from the attachment. Adding a new column could make it easy.
DaysCost = VAR currentId = [ID] VAR currentRequest = [Request] VAR currentSeq = [Sequence number] VAR currentActor = [Pending action from] VAR nextDate = CALCULATE ( MIN ( Table1[Approved Date] ), FILTER ( Table1, Table1[Sequence number] = currentSeq + 1 && [ID] = currentId && Table1[Request] = currentRequest ) ) VAR nextActor = CALCULATE ( MIN ( Table1[Pending action from] ), FILTER ( Table1, Table1[Sequence number] = currentSeq + 1 && [ID] = currentId && Table1[Request] = currentRequest ) ) RETURN IF ( [Pending action from] = nextActor && nextDate = [Approved Date], 0, CALCULATE ( SUM ( 'Calendar'[ifWorkday] ), FILTER ( 'Calendar', [Date] >= [Approved Date] && [Date] <= nextDate ) ) )
Best Regards,
v-jiascu-msft
7 years agoMicrosoft Employee
Hi Mike,
Please download the demo from the attachment. Adding a new column could make it easy.
DaysCost = VAR currentId = [ID] VAR currentRequest = [Request] VAR currentSeq = [Sequence number] VAR currentActor = [Pending action from] VAR nextDate = CALCULATE ( MIN ( Table1[Approved Date] ), FILTER ( Table1, Table1[Sequence number] = currentSeq + 1 && [ID] = currentId && Table1[Request] = currentRequest ) ) VAR nextActor = CALCULATE ( MIN ( Table1[Pending action from] ), FILTER ( Table1, Table1[Sequence number] = currentSeq + 1 && [ID] = currentId && Table1[Request] = currentRequest ) ) RETURN IF ( [Pending action from] = nextActor && nextDate = [Approved Date], 0, CALCULATE ( SUM ( 'Calendar'[ifWorkday] ), FILTER ( 'Calendar', [Date] >= [Approved Date] && [Date] <= nextDate ) ) )
Best Regards,
Mike22
7 years agoHelper III
Hey Dale,
Thank you soo much this does it perfectly! You have been of great help!
Best Regards,
Mike