Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ConnorH
Employee
Employee

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)

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ConnorH , What output you need. You have created date and status date with you, you can take a date diff.

 

new column = Datediff([created_date],[status change date],day)

 

In case you want to have diff with the previous record. refer to this

https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ConnorH , What output you need. You have created date and status date with you, you can take a date diff.

 

new column = Datediff([created_date],[status change date],day)

 

In case you want to have diff with the previous record. refer to this

https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Hi @ConnorH,

 

is your problem solved?

 

Cheers,
Sturla

Yes sorry, I pressed delete on this post but I guess it didnt get deleted.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.