Forum Discussion
Calculation between 2 dates based on the same value
There's no task.expired_from_workbin in your data, only task.expired_from_step??
Had a quick look (see it all at work in the attached file). The measure seems to work fine for cases like ID
541fe1360f4ca114df0000bc
but is slightly off at ID
56e1917d7765624c6b0001fd
because task 5fcfa098bd0e54813b1340de appears in two instances ( taken-completed, resume-completed)
and yields negative numbers at cases like ID
4fc675c20f4ca11924008111
where the code works well but the data only has a task.taken for taskID 5fd0b96871336830f56f98f2, which messes the result up
Dealing with those cases will be trickier but the code can give you a good start. In any case you will need to exactly define all of the possible cases in which the data can appear and, equally important, define how to deal with them
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers