Forum Discussion
Finding days between two rows date values
- Anonymous6 years ago
Hi ConnorH ,
Create a Calculated Column
Column = VAR _prevstage_sameprojId_date = CALCULATE ( MAX ( 'Table1'[Modified date] ), FILTER ( 'Table1', 'Table1'[Modified date] < EARLIER ( 'Table1'[Modified date] ) && Table1[Project ID] = EARLIER ( Table1[Project ID] ) ) ) RETURN DATEDIFF ( _prevstage_sameprojId_date, 'Table1'[Modified date], DAY )Regards,
Harsh NathaniAppreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi ConnorH ,
Create a Calculated Column
Column =
VAR _prevstage_sameprojId_date =
CALCULATE (
MAX ( 'Table1'[Modified date] ),
FILTER (
'Table1',
'Table1'[Modified date]
< EARLIER ( 'Table1'[Modified date] )
&& Table1[Project ID]
= EARLIER ( Table1[Project ID] )
)
)
RETURN
DATEDIFF (
_prevstage_sameprojId_date,
'Table1'[Modified date],
DAY
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
I have a similar instance where I would really aprecaite your help.
I am trying to create a column that finds the number of workingdays (excluding weekends and bankholidays - I have a list of all bank holidays in a table) between Milestones but the Audit Review ID must be the same. I will need to calculate the difference between the End Day of Milestone 1 with the end date with Milestone 2 and so on... Not all Audit Reviews have an End Date for all 7 milestones, some only have a few as seen in example.
| Audit Review ID | Milestone Type | Milestone End Date |
| 123456 | 1. Background Research | 01/12/2021 |
| 123456 | 2. Terms of Reference | 03/02/2022 |
| 123456 | 3. Opening Meeting | 04/03/2022 |
| 123456 | 4. Fieldwork and Closing Meeting | 21/03/2022 |
| 123456 | 5. Draft Report | 25/03/2022 |
| 123456 | 6. Management Responses | 29/03/2022 |
| 123456 | 7. Final Report | 07/04/2021 |
| 234567 | 1. Background Research | 01/01/2022 |
| 234567 | 2. Terms of Reference | 03/01/2022 |
| 234567 | 3. Opening Meeting | 04/02/2022 |
| 234567 | 4. Fieldwork and Closing Meeting | 12/02/2022 |
| 345678 | 1. Background Research | 01/01/2021 |
| 345678 | 2. Terms of Reference | 23/01/2022 |
For example, I would expect a value of 5 for the difference between (4. Fieldwork & Closing Meeting) and (5. Draft Report) for Audit 123456.
Would apprecaite your help.