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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.