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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Calculate Dynamic average time

In my tabe i have each employees timgings for each day.

 

i would like to calculate the average timings for each employee as time range changes.

 

sample data:- 

 

Emp IDTime
1362259:07:31 AM
1362259:36:45 AM
1362259:42:04 AM
1362259:42:11 AM
1362259:42:49 AM
1362259:44:49 AM
1362259:46:44 AM
1362259:48:23 AM
1362259:50:23 AM
1362259:51:27 AM
1362259:53:49 AM
1362259:54:15 AM
1362259:56:39 AM
13622510:05:49 AM
13622510:18:34 AM
13622510:43:22 AM
13622512:35:58 PM

 

I have tried several formulas but i couldnt get what i am expecting.

 

1:-

 

AvgTime = CALCULATE(
		FORMAT(AVERAGE('Table'[Time]),"HH:MM:SS"),
		ALLEXCEPT('Table','Table'[Emp ID]))

But it is giving me the overall average for that perticular employee irrespective of the date range change from the slicer which is a column from the same table.

 

Capture.JPG

IF i change the range in begin_date slicer then the values wont change accordingly.

 

2:- 

AvgTime = CALCULATE(
            FORMAT(AVERAGE('Table'[Table]),"HH:MM:SS"),
            ALLSELECTED('Table'))

Page1.JPG

For above dax, it is giving me the average time if i select a perticular id .
but if i choose multiple ids from slicer then it is giving me the above values that is cumulative average for those selected ids.

 

How can i get the average for each indivudual employeees average time which gets changes as the date range values changes.

 

 

Please help.

 

Mohan V.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Got by myself..

 

Below query worked.

 

AvgTime = CALCULATE(FORMAT(AVERAGE('Table'[Time]),"HH:MM:SS"),FILTER(ALLEXCEPT('Table','Table'[Emp ID]),
    'Table'[begin_date] <= MAX('Table'[begin_date])))

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Got by myself..

 

Below query worked.

 

AvgTime = CALCULATE(FORMAT(AVERAGE('Table'[Time]),"HH:MM:SS"),FILTER(ALLEXCEPT('Table','Table'[Emp ID]),
    'Table'[begin_date] <= MAX('Table'[begin_date])))

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.