Forum Discussion
DatediffbyRows
Hi,
I am looking for solution to calculate DAYs difference between Process1 date and Process3 date for each project in calculated column.
Project ProcessDate
ProjectID DiffProcess1andProcess3Days ProjectID ProcessName Date
1 | ?? 1 Process1 05.01.2018
2 | ?? 1 Process2 12.01.2018
1 Process3 28.01.2018
2 Process1 04.02.2018
2 Process2 06.02.2018
2 Process3 24.02.2018
Hi Marcin,
Try this measure please.
Measure = VAR p1Date = CALCULATE ( MIN ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, 'Table1'[ProjectID] ), 'Table1'[ProcessName] = "Process1" ) ) VAR p3Date = CALCULATE ( MIN ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( 'Table1', Table1[ProjectID] ), 'Table1'[ProcessName] = "Process3" ) ) RETURN DATEDIFF ( p1Date, p3Date, DAY )Best Regards,
Dale
2 Replies
- v-jiascu-msftMicrosoft Employee
Hi Marcin,
Try this measure please.
Measure = VAR p1Date = CALCULATE ( MIN ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( Table1, 'Table1'[ProjectID] ), 'Table1'[ProcessName] = "Process1" ) ) VAR p3Date = CALCULATE ( MIN ( 'Table1'[Date] ), FILTER ( ALLEXCEPT ( 'Table1', Table1[ProjectID] ), 'Table1'[ProcessName] = "Process3" ) ) RETURN DATEDIFF ( p1Date, p3Date, DAY )Best Regards,
Dale
- MarcinHelper V
Hi,
thanks for help, that work for me, but I had to remove ALLEXCEPT function so that it would work when I used measure in Project column.