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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JoaoMS
Helper III
Helper III

Duration between last date and start date of a list

Hi all,

I'm trying to figure out how to calculate the duration between two dates of a serie of registers of a list. This list is related to the dates in which our equiptments are out of service due to maintenance. For example:

 

PLANTUNITTypeDescriptionDay
AG4MPGenerator 4 Maintenance20/04/2022
AG4MPGenerator 4 Maintenance21/04/2022
AG4MPGenerator 4 Maintenance22/04/2022
BG1MPGenerator 1 Maintenance20/06/2002
BG1MPGenerator 1 Maintenance21/06/2002
BG1MPGenerator 1 Maintenance22/06/2002
BG1MPGenerator 1 Maintenance23/06/2002
BG1MCLExtension of G1 Maintenance24/06/2002
BG1MCLExtension of G1 Maintenance25/06/2002
CG3MPGenerator 3 Maintenance27/08/2022
CG3MPGenerator 3 Maintenance28/08/2022
CG3MCLExtension of G3 Maintenance29/08/2022

 

But as you can expect we have a bigger list of registers, and we just want a summary as follow based on the previous list:

 

Fifure 2.png

We just want a Table visualization in our dashboard but I don't know how to calculate the duration days between the last day and the start day of single maintenante description. I just can have the following table, so I'm missing the last column. Thanks in advance:

Figure.png

Joao

 

1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @JoaoMS,

 

Create a summary table using this formula:

 

Summary = SUMMARIZE('Table', 'Table'[PLANT], 'Table'[UNIT], 'Table'[Type], 'Table'[Description], "Start Date", MIN('Table'[Day]), "End Date", MAX('Table'[Day]))

 

Then add this column for duration:

 

Duration = DATEDIFF(Summary[Start Date],Summary[End Date],DAY) + 1

 

Screenshot 2022-10-24 024711.jpg

 

Mark this post as a solution if that works for you!
Consider taking a look at my blog: How to Export Telemetry Data from Azure IoT Central into Power BI

View solution in original post

1 REPLY 1
Shaurya
Memorable Member
Memorable Member

Hi @JoaoMS,

 

Create a summary table using this formula:

 

Summary = SUMMARIZE('Table', 'Table'[PLANT], 'Table'[UNIT], 'Table'[Type], 'Table'[Description], "Start Date", MIN('Table'[Day]), "End Date", MAX('Table'[Day]))

 

Then add this column for duration:

 

Duration = DATEDIFF(Summary[Start Date],Summary[End Date],DAY) + 1

 

Screenshot 2022-10-24 024711.jpg

 

Mark this post as a solution if that works for you!
Consider taking a look at my blog: How to Export Telemetry Data from Azure IoT Central into Power BI

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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