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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
DAX_newbiee
New Member

Calculate time between 2 process

Hello Guys,
Need your help in calculating the time between the two process (ABC and XYZ) then add the difference to get a total time difference using DAX measure.
Here is the screenshot

DAX_newbiee_0-1702547816425.png

Your help is appreciated.

1 ACCEPTED SOLUTION

hI @DAX_newbiee ,

 

Please see attached sample pbix.

danextian_0-1702785490872.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
DAX_newbiee
New Member

Hi @danextian 
Sorry for the late reply.

Part_NameDatetimeStationProcesses
A03-10-2023 20:11ZXYZ
A03-10-2023 23:42ZABC
A03-10-2023 23:42ZABC
A04-10-2023 00:42ZXYZ
A04-10-2023 03:29ZABC
A04-10-2023 03:29ZABC
A05-10-2023 00:26ZXYZ
A05-10-2023 02:17ZABC
A05-10-2023 02:17ZABC

 

Here is the table.
I want to calculate the time taken by the part A from process XYZ to ABC (example: Subtract 20:11 from 23:42) for XYZ to ABC likewise (subtract 00:42 from  03:29) and so on.
after calculating the difference add all the difference to get the total time( subtract 1 + subtract 2 + subtract 3).
I hope it is clear now

@danextian 
If process is XYZ then to calculate the difference immediate next row, which is having ABC should be picked.
and always process time is calculated from XYZ to ABC not vice versa.
Your help would be much appreaciated

hI @DAX_newbiee ,

 

Please see attached sample pbix.

danextian_0-1702785490872.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian thank you so much for the help it worked

danextian
Super User
Super User

Hi @DAX_newbiee ,

As always, please post a sample data that we can copy-paste (not an image).  Also, you said to get the time between two processes ABC and XYZ but which row/s should be picked?  You mean to get the difference between this datetime to the next datetime for each process?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.