Forum Discussion

ConnorH's avatar
ConnorH
Microsoft Employee
6 years ago
Solved

Finding days between project status changes

I have tried a number of things to try to make this work but I can not seem to figure it out. I have a project table which holds the created date for a project and a status table which holds status change dates and project status as a decimal. A project may have many different status changes.

 

My Goal is to find the time between the created date for a project and each status change. I am not sure if I need to use the project table or not considering the status tables contains the created date for the project. 

 

Project IDStatus ExtractStatus Change DateCreated date
135683.07/15/207/10/20
135684.07/16/207/10/20
155981.07/18/207/16/20
155982.07/20/207/16/20
135683.07/20/207/10/20

 

Things to keep in mind: a project can go backwards or forward  with status changes, status Extract starts at 1.0 and ends a 4.0, and there is a Primary key on the status table. Product ID is the FK in the status table while it is the primary key in the product table.

 

I have tried a couple things. This is an example of one thing I have tried but it didn't work. 

Column = If(DISTINCTCOUNT('Status'[Status Extract])>1, DATEDIFF('Status'[Created], MAX(Project[Status Changed]),DAY), 0)

 

3 Replies