Forum Discussion

MartaBak's avatar
MartaBak
Regular Visitor
2 years ago
Solved

employee data compared to the team average.

I have two columns [Mail ID] and [employee] I need to get the average number of all e-mails [email id] and then show for each employee by what percentage it exceeds or does not exceed a given average.

For example, we have 5,900 emails and 7 employees. 

Employee 1 make 230 emails.

Employee 2 made 1,000

emails average = 5900/7 = 843

Employee 1 = 230/843 = 27%

Employee 2 = 1000/843 = 119%

I have a basic formula that counts the email id [ E-MAILS =COUNTROWS('N MCT')] and the number of employees [LP.EMPLY =DISTINCTCOUNT('N MCT'[Agent Name])] then [ AVER = [E-MAILS/LP. EMPLY] and this solution works like I'm creating a matrix - but when I want to present the result in a card, it simply shows me the number of e-mails for this employee.

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, MartaBak

     

    May I ask if this is the expected output you are looking for? Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.

    Measures:

    E-MAILS =
    COUNTROWS('Table')
    
    LP.EMPLY =
    DISTINCTCOUNT('Table'[Employee])
    
    AvgEmail =
    'Table'[E-MAILS]/'Table'[LP.EMPLY]
    
    EmailNumbyEmployee1 =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            'Table'[Employee] = SELECTEDVALUE ( 'Employee_1'[Employees] )
        )
    )
    PercentEmail =
    [EmailNumbyEmployee1]/[AvgEmail]

    If this does not work, could you please share some sample data without sensitive information and expected output.
    How to provide sample data in the Power BI Forum - Microsoft Fabric Community

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

4 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, MartaBak

     

    May I ask if this is the expected output you are looking for? Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.

    Measures:

    E-MAILS =
    COUNTROWS('Table')
    
    LP.EMPLY =
    DISTINCTCOUNT('Table'[Employee])
    
    AvgEmail =
    'Table'[E-MAILS]/'Table'[LP.EMPLY]
    
    EmailNumbyEmployee1 =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            'Table'[Employee] = SELECTEDVALUE ( 'Employee_1'[Employees] )
        )
    )
    PercentEmail =
    [EmailNumbyEmployee1]/[AvgEmail]

    If this does not work, could you please share some sample data without sensitive information and expected output.
    How to provide sample data in the Power BI Forum - Microsoft Fabric Community

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

  • MartaBak's avatar
    MartaBak
    Regular Visitor

    Sorry for not responding.

    Below more data : 

     

    Table[Data]

    employeeDATEid EMAIL 
    X20.02.2024123456
    Y20.02.2024123456
    Z20.02.2024123456
    Z20.02.2024123456
    Z20.02.2024123456
    Z20.02.2024123457
    Z20.02.2024123458
    Z20.02.2024123459
    X20.02.2024123459
    X20.02.2024123459
    Y20.02.2024123459
    X20.02.2024112345
    X20.02.2024112549
    Y20.02.2024123584
    Z20.02.2024123695

     

    What I need :

    1. Sum of all e-mail per employee [lp]

    2. percentage of employee participation compared to the average, which we assume as 100% [%]

    3. employee name [EMPLOYEE]

     

    example : 

    sum of e-mail = 15

    amount of employess =3 (X,Y,Z)

    ave. email = 15/3=5

    employee participation X =5/5 = 100% , Y= 3/5 = 60%, Z=7/5= 140%

     

     

    EMPLOYEElp%
    X5100%
    Y360%
    Z7140%
    AVEREGE5100%

     

     

    I don't know why my previos answer befor 4h doesn't showed 😞

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      This thread has already been marked as solved.  It would be better to open a new one.