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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Weighted Average per week and per month

 

Weighted Average.jpg

 

In the callcenter is the AHT very important

we have AHT per day of each employee, but we need several measures:

1. Weighted Average per week per employee 

2. Weighted Average per month per employee

3. Weighted Average per week per team

4. Weighted Average per month per team

 

kind regards

1 ACCEPTED SOLUTION

Hey,

thanks for uploading the sample data.

I created the following measures:

 

 

avg empl week = 
AVERAGEX(
    'Blad1'
    ,
    var currentName = 'Blad1'[Name]
    var currentWeek = 'Blad1'[Week]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Name] = currentName
        ,'Blad1'[Week] = currentWeek
    )
)

 

 

 

 

avg empl month = 
AVERAGEX(
    'Blad1'
    ,
    var currentName = 'Blad1'[Name]
    var currentMonth = 'Blad1'[Month]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Name] = currentName
        ,'Blad1'[Month] = currentMonth
    )
)

 

 

 

avg team week = 
AVERAGEX(
    'Blad1'
    ,
    var currentTeam = 'Blad1'[Team]    
    var currentWeek = 'Blad1'[Week]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Team] = currentTeam
        ,'Blad1'[Week] = currentWeek
    )
)

 

avg team month = 
AVERAGEX(
    'Blad1'
    ,
    var currentTeam = 'Blad1'[Team]    
    var currentMonth = 'Blad1'[Month]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Team] = currentTeam
        ,'Blad1'[Month] = currentMonth
    )
)

Here is a screenshot that is based on the sample data you provided:

image.png

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

please provide the samle data from the embedded jpg as an excel file, upload the file to onedrive or dropbox and share the link.

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hey,

thanks for uploading the sample data.

I created the following measures:

 

 

avg empl week = 
AVERAGEX(
    'Blad1'
    ,
    var currentName = 'Blad1'[Name]
    var currentWeek = 'Blad1'[Week]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Name] = currentName
        ,'Blad1'[Week] = currentWeek
    )
)

 

 

 

 

avg empl month = 
AVERAGEX(
    'Blad1'
    ,
    var currentName = 'Blad1'[Name]
    var currentMonth = 'Blad1'[Month]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Name] = currentName
        ,'Blad1'[Month] = currentMonth
    )
)

 

 

 

avg team week = 
AVERAGEX(
    'Blad1'
    ,
    var currentTeam = 'Blad1'[Team]    
    var currentWeek = 'Blad1'[Week]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Team] = currentTeam
        ,'Blad1'[Week] = currentWeek
    )
)

 

avg team month = 
AVERAGEX(
    'Blad1'
    ,
    var currentTeam = 'Blad1'[Team]    
    var currentMonth = 'Blad1'[Month]
    return
    CALCULATE(
        AVERAGE('Blad1'[AHT])
        ,ALL(Blad1)
        ,'Blad1'[Team] = currentTeam
        ,'Blad1'[Month] = currentMonth
    )
)

Here is a screenshot that is based on the sample data you provided:

image.png

 

Hopefully this is what you are looking for.

 

Regards,

Tom

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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