Forum Discussion

Benji88's avatar
Benji88
Copper Contributor
Jun 03, 2022
Solved

Getting the average number of working days for users

Hi, I'd like to know if there's a solution to an issue I'm experiencing with Power Pivot / DAX.    I have a table with calls handled by each member of a team. By doing a distinct count of the dates...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jun 06, 2022

    Benji88 

    Sorry, I misunderstood the logic. Please try

    Average days:=VAR daysPerPerson =
        SUMMARIZE ( Calls2, Calls2[IRF_START_DATE], Calls2[RESOURCE_NAME] )
    VAR teamDays =
        COUNTROWS ( daysPerPerson )
    VAR team =
        DISTINCTCOUNT ( Calls2[RESOURCE_NAME] )
    RETURN
        DIVIDE ( teamDays, team, 0 )
    
    /////////
    Number of days:=DISTINCTCOUNT ( Calls2[IRF_START_DATE] )
    
    ////////
    Days on Call to Average, %:=VAR averageForTeam =
        CALCULATE ( [Average days], ALL ( Calls2[RESOURCE_NAME] ) )
    RETURN
        DIVIDE ( [Number of days], averageForTeam, 0 )

    in attached file

Resources