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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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