Forum Discussion
Anonymous
7 years agoNot applicable
DATEDIFF with filter
Hallo everybody, I have a table that looks something like this, Job old status new status old date 115728 o TG 18-1-2018 115728 TG B 2-3-2018 115728 B A 2-3-2018 200 ...
- Anonymous6 years ago
This code does exactly what you need it to do.
Previous Date = VAR PreviousRow = TOPN ( 1; FILTER ( Blad1; Blad1[old date] < EARLIER ( Blad1[CRH_REQDATE] ) && Blad1[job] = EARLIER ( Blad1[job] ) ); Blad1[old date]; DESC ) VAR PreviousValue = MINX ( PreviousRow; Blad1[old date] ) RETURN DATEDIFF ( PreviousValue; Blad1[old date]; DAY )If this reply solved your issues be sure to mark it as the solution.
Anonymous
7 years agoNot applicable
The formulation of the conditions is ambiguous. Please give a full explanation of what you want to calculate for Job 200 as it looks like a job can go through stage B several times.
Best
D.
Best
D.
- Anonymous7 years agoNot applicable
Job 200 = new status "B" = old status TG
TG had new status date 6-2-2019 - B had the new status date 7-2-2019.
so the new status B from the old status TG is one day old.
I hope this is better. Anonymous