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

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

Reply
jamiehandelman
Frequent Visitor

Calculating Machine Hours Per Day when days span multiple days

Hello, 

I have a dataset with 3 dates and a duration: 

- Date

- StageTimeStart

- StageTimeStop 

- Pump Time in Hours (duration between StageTimeStart and StageTimeStop). 

 

I need to calculate the number of hours per day that the pump is running but sometimes the StageStopTime is the day after the StageStartTime. The hours in the next day need to show up for the next day, not on the day it started. 

 

I've looked at other forums but have yet to find a solution that works for me. 

Any guidance would be excellent! 

3 REPLIES 3
lbendlin
Super User
Super User

use a combination of GENERATESERIES and INTERSECT  (or TREATAS).

 

What should happen when the pump starts or stops inside an hour, let's say at the 23 Minute mark?  What is your expected granularity?

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi @lbendlin , thank you for your response. Here is a link to a PBIX file in OneDrive that has sample data. The goal would be to show hours by day, and when the pump stops inside of an hour, we would use a fraction of that hour. I.e. if the pump started at 10:30 PM on 10/24/2023, but stopped at 2:30 AM on 10/25/2023, it would show 1.5 hours for 10/24 and 2.5 hours for 10/25. 
Thank you for your help!

lbendlin_0-1698181955097.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.