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
andris_
Resolver I
Resolver I

average starting/finishing time

Hey everyone,

 

we have a data table with technicians (~40 technicians) who work in zones (5 zones). We're trying to create a report which contains monthly performance analysis about them. But we have an issue with the average starting and finishing time.

 

The average starting (and finishing) time measure is working perfectly when we use it on technician level. The measure is the following:

Average Starting Time =
VAR Result =
AVERAGEX ( VALUES ( 'Date'[Date] ); CALCULATE ( MIN (DataTable[Travel Starting Time] );DataTable[Weekday/Weekend]="Weekday" ) )
RETURN
IF ( NOT ( ISBLANK ( Result ) ); Result + TIME ( 0; 0; 0 ) )

(So, it returns the average of the minimum of the travel starting times a day, which works for daily, weekly and monthly periods as well)

 

The problem is that when we use it on zone level, it is not working, because it picks the lowest travel starting time from every day, which is obviously wrong, because what we need is the average of lowest travel starting times from every technician (from the particular zone) a day, and after the average of that (so, the average of the average daily lowest travel starting times).

 

You can ask yourself the question "Why this guy needs the lowest travel starting times?". The answer is, because every technician have a few service orders a day, and each service order has its own starting time. And in our case, we need the lowest one, because, of course that will be the starting time of the technicians' workday. (We have the same problems with the finishing time. In that case, we need the max of the finishing times a day.)

 

Here's some sample data:

samplekep.PNG

 

I hope my problem is clear, but if it isn't, don't hesitate to hit me with questions, please! 

 

Thanks in advance,

Andris

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @andris_,

 

Regarding the sample data, what's the expected results? Would you please clarify it?

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft,

The sample data is not the best to explain it, I just wanted to show how the data looks like. But let's assume that all of the 4 technicians (Name1, Name2, Name3, Name4) are from the same zone. So, we'd like to choose from each day from each technicians the lowest starting date, calculate the average of it for a period (month) for each technicians (that's what the measure I've mentioned can do), and after calculate the average of the technicians' average starting time.
I hope now it's clear.

Regards,
Andris

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.