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
jl20
Helper IV
Helper IV

Average of a Distinct Count - DAX needed

Hi all,

 

I'm looking to write a measure that calculates the average number of jobs an employee works per day (they may work one or more than one job per day). I'm not interested in days where they don't work (i.e., the average should only include dates in which they work). It will be easiest to just show you what I'm trying to achieve with some sample data. Looking for the code that will get me the bolded results below.

 

Dataset:  
Job NumberDate WorkedEmployee #
2652710/1/2015Employee 1
2652710/2/2015Employee 1
2826610/1/2015Employee 2
2929610/1/2015Employee 2
2801210/2/2015Employee 2
2770810/5/2015Employee 2
2826610/5/2015Employee 2
2635310/1/2015Employee 3
2680310/1/2015Employee 3
2680310/2/2015Employee 3
2680310/3/2015Employee 3
   
Desired Results: 
EmployeeAverage # of Distinct Jobs per DayDays Worked
Employee 11.02
Employee 21.73
Employee 31.33

 

Thanks in advance for your help!

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

This should give you the desired output Smiley Happy

Average # of Distinct Jobs per Day =
DIVIDE (
    CALCULATE (
        COUNTA ( 'Table'[Job Number] ),
        ALLEXCEPT ( 'Table', 'Table'[Employee #] )
    ),
    DISTINCTCOUNT ( 'Table'[Date Worked] ),
    0
)

Average # of Distinct Jobs per Day.png 

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

This should give you the desired output Smiley Happy

Average # of Distinct Jobs per Day =
DIVIDE (
    CALCULATE (
        COUNTA ( 'Table'[Job Number] ),
        ALLEXCEPT ( 'Table', 'Table'[Employee #] )
    ),
    DISTINCTCOUNT ( 'Table'[Date Worked] ),
    0
)

Average # of Distinct Jobs per Day.png 

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.

Top Solution Authors
Top Kudoed Authors