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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Minute in between timestamp

Hello,

 

Im wondering if this is possible, this is my table result.

So I have a Table with Column Timestamp on it. I create a  new column to compute hour of the Timestamp column.
So when im summarizing the result, the Minutes(date diff max and min) shows incorrect. If you look below
hour 6 should by 60 since the we start at hour 5 and end on hour 8. is there a way to make Minute column compute as follows?
Hour 5 = 29
Hour 6 = 60

Hour 7 = 60
Hour 8 = 20

 

BatchNumberHourDate diff max and min
A529
A659
A757
A820
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

I created a sample data. Where I assumed batch has a start and end time.

I also created time buckets of every hour

 

Then used CrossJoin to create a new table. (This can be imported for less number of columns)

and then calculated the hourly minutes

 

Refer to the table: 'Table' in the pbix , check the last 3 columns.

https://www.dropbox.com/s/5wo5jhzl488zy69/Minute_between%20Hours.pbix?dl=0

Table = filter(CROSSJOIN('time bucket','Batch'),('time bucket'[Start] <= 'Batch'[B End] && 'time bucket'[End] >= 'Batch'[B Start]))
Final End = if('Table'[B End]<'Table'[End],'Table'[B End],'Table'[End]) 
Final Start = if('Table'[B Start]>'Table'[Start],'Table'[B Start],'Table'[Start]) 
Min Diff = DATEDIFF('Table'[Final Start],'Table'[Final End],MINUTE)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

I created a sample data. Where I assumed batch has a start and end time.

I also created time buckets of every hour

 

Then used CrossJoin to create a new table. (This can be imported for less number of columns)

and then calculated the hourly minutes

 

Refer to the table: 'Table' in the pbix , check the last 3 columns.

https://www.dropbox.com/s/5wo5jhzl488zy69/Minute_between%20Hours.pbix?dl=0

Table = filter(CROSSJOIN('time bucket','Batch'),('time bucket'[Start] <= 'Batch'[B End] && 'time bucket'[End] >= 'Batch'[B Start]))
Final End = if('Table'[B End]<'Table'[End],'Table'[B End],'Table'[End]) 
Final Start = if('Table'[B Start]>'Table'[Start],'Table'[B Start],'Table'[Start]) 
Min Diff = DATEDIFF('Table'[Final Start],'Table'[Final End],MINUTE)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors