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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
T-Pan
Helper I
Helper I

Average per employee

I have the following dataset:

Date       EmployeName   Operations

1/1/23.    A.                        15

1/1/23.    B.                         20

1/1/23.    C.                         7

 

For every date, i want to calculate the average operations (sum operations per date divided by the number of employess appears in the same date).

 

 

1 ACCEPTED SOLUTION

Hi, @T-Pan 

 

You can try the following methods. distinct count resolved by (all activities) is a measure.

Measure = 
Var _N1=CALCULATE(SUM('Table'[Count Operations]),ALL('Table'))
Var _table=SUMMARIZE('Table','Table'[Day],"Distinct",[distinct count resolved by (all activities )])
Var _N2=SUMX(_table,[Distinct])
RETURN
DIVIDE(_N1,_N2)

vzhangti_0-1703502170320.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

7 REPLIES 7
T-Pan
Helper I
Helper I

This is my table, resolved by column Represents the name of employess, count of operations represents an operations, resolution date is the timestamp where the operation completed.
TPan_3-1703159535172.png

The follow image is an table i have created to expalin what i want to measure

TPan_4-1703159706821.png

I want to divide the value '17660' by the sum of last column whic represents the distinct names of employess in each date and is the follow measure : (distinct count resolved by (all activities) = distinctcount('ALL ACTIVITIES'[resolved by].))

 

Hi, @T-Pan 

 

You can try the following methods. distinct count resolved by (all activities) is a measure.

Measure = 
Var _N1=CALCULATE(SUM('Table'[Count Operations]),ALL('Table'))
Var _table=SUMMARIZE('Table','Table'[Day],"Distinct",[distinct count resolved by (all activities )])
Var _N2=SUMX(_table,[Distinct])
RETURN
DIVIDE(_N1,_N2)

vzhangti_0-1703502170320.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

Yes the result is the same with the measure that i create, which is the following: 

Average Activities per Distinct Analyst per Date =

DIVIDE(

SUM('All Activities Table'[Count Operations]),

SUMX(VALUES('All Activities Table'[Resolution Date Only]),

CALCULATE(DISTINCTCOUNT('All Activities Table'[Resolved By]))

)

)

Hi, @T-Pan 

try below

measure =
var a = sumx('ALL ACTIVITIES',[(distinct count resolved by (all activities)])
var b = calculate(sum('ALL ACTIVITIES'[count operation]),removefilters())
return
divide(b,a)
Dangar332
Super User
Super User

Hi, @T-Pan 

for new column try below

just adjust table name

 

Column = 
var a = 'Table (2)'[date]
var b = SUMX(FILTER('Table (2)','Table (2)'[date]=a),'Table (2)'[operation])
var c = COUNTX(FILTER('Table (2)','Table (2)'[date]=a),'Table (2)'[emp name])
return
DIVIDE(b,c)

 

 

and for measure try below

Measure 2 = 
var a = SUMX(FILTER(all('Table (2)'),'Table (2)'[date]=MAX('Table (2)'[date])),'Table (2)'[operation])
var b = COUNTX(FILTER(all('Table (2)'),'Table (2)'[date]=MAX('Table (2)'[date])),'Table (2)'[emp name])
RETURN
DIVIDE(a,b)

This is my table, resolved by column Represents the name of employess, count of operations represents an operations, resolution date is the timestamp where the operation completed.
TPan_3-1703159535172.png

The follow image is an table i have created to expalin what i want to measure

TPan_4-1703159706821.png

I want to divide the value '17660' by the sum of last column whic represents the distinct names of employess in each date and is the follow measure : (distinct count resolved by (all activities) = distinctcount('ALL ACTIVITIES'[resolved by].))

 

VahidDM
Super User
Super User

Hey @T-Pan 

 

Can you post a sample of the expected output?

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.