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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Average of time records

Hi,

 

I want to calculate the time that a certain object was at a point. I have the travel time of the object and I also have the absolute time of the object. I want to know the time at the point of the object for all Absolut time records, this looks like this for example:

Capture.PNG

my current formula looks like this:

 

TimeAtPoint = CALCULATE([TotalAbsoluteTime]) - CALCULATE([TotalTravelTime])

 

Measures used are:

//TotalAbsoluteTime = SUM(Table[AbsoluteTime])

//TotalTravelTime = SUM(Table[TravelTime])

 

although this works, I know this is'nt correct since the TotalAbsoluteTime is exceeding 24 hours. since it is exceeding 24 hours the next step gives wrong data. The next step is to calculate the average of the TimeAtPoint per object.

 

Thanks in advance !

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

From the example you provided, you want to get the value of TimeAtPoint for each Object record, right? If so, you can add a calculated column in original table using this simple formula:

TimeAtPoint = 'time records'[AbsoluteTime]-'time records'[TravelTime]

 

To get the average value of TimeAtPoint per Object, you can still create a calculated column using this formula:

Average =
CALCULATE (
    AVERAGE ( 'time records'[TimeAtPoint] ),
    ALLEXCEPT ( 'time records', 'time records'[Object] )
)

2.PNG

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

From the example you provided, you want to get the value of TimeAtPoint for each Object record, right? If so, you can add a calculated column in original table using this simple formula:

TimeAtPoint = 'time records'[AbsoluteTime]-'time records'[TravelTime]

 

To get the average value of TimeAtPoint per Object, you can still create a calculated column using this formula:

Average =
CALCULATE (
    AVERAGE ( 'time records'[TimeAtPoint] ),
    ALLEXCEPT ( 'time records', 'time records'[Object] )
)

2.PNG

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft,

 

This worked perfectly ! this was exactly what I was trying to achieve.

 

Thankyou very much for helping me.

 

Kind regards,

L. Meijdam

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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