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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Calculation of average time by columns start time and end time

I have columns of start time and end time in the next format:

yyyy-mm-dd hh:mm

 

what in need to do if i want to calculate and show the avargte time per day?

i need to do something like that:

sum of (end time - start time) div by Num of Application

 

how should i do it?

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create measures like below:

Datediff = DATEDIFF(MAX('Table'[Start Datetime]),MAX('Table'[End Datetime]),MINUTE)
_Sum_Datediff = 
sumx(
    FILTER(ALL('Table'),EDATE('Table'[Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)),
    [Datediff])
_Num of Application = CALCULATE(COUNT('Table'[Application]),FILTER(ALL('Table'),EDATE([Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)))
avargte time per day = [_Sum_Datediff]/[_Num of Application]

 Result:

vangzhengmsft_0-1640596604469.png

 

Please refer to the attachment below for details. Hope this helps.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

Try to create measures like below:

Datediff = DATEDIFF(MAX('Table'[Start Datetime]),MAX('Table'[End Datetime]),MINUTE)
_Sum_Datediff = 
sumx(
    FILTER(ALL('Table'),EDATE('Table'[Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)),
    [Datediff])
_Num of Application = CALCULATE(COUNT('Table'[Application]),FILTER(ALL('Table'),EDATE([Start Datetime],0)=EDATE(MAX('Table'[Start Datetime]),0)))
avargte time per day = [_Sum_Datediff]/[_Num of Application]

 Result:

vangzhengmsft_0-1640596604469.png

 

Please refer to the attachment below for details. Hope this helps.

 

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Anonymous , these should be in datetime format 

 

then you can use datediff 

 

in a measure 

sumx(Table, datediff([Statdatetime] ,[enddatetime], second) )  

 

You can use minute, hour , day etc 

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.