Forum Discussion

KKilpatrick34's avatar
KKilpatrick34
Regular Visitor
3 years ago
Solved

How to Calculate Weekly Average Per Person

Hi I am looking to do a weekly average for days that employees clock into an office using the data held in this data per employee but unsure what formula to use if anyone had any ideas they would be ...
  • speedramps's avatar
    3 years ago

    Use Power Query to crate a calenadar file with contgius dates and week using Date.StartOfWeek

    Learn about calandars here Calendar Table training

     

    Relate the calendar to your fact table by date

     

    Create a measures

     

    numberofdays = DISTINCTCOUNT(tablename[Date]]

     

    Then produce a report ro graph of nunberofdays by calendar[week]]

     

    Thanks for reaching out for help.

    I put in a lot of effort to help you, now please quickly help me by giving kudos.

    Remember we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

    If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

    One question per ticket please. If you need to extend your request then please raise a new ticket.

    You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

     

     

     

  • v-yanjiang-msft's avatar
    3 years ago

    Hi KKilpatrick34 ,

    According to your description, in my understanding, you want to calculate the number of days per employee per week. In this way, it has nothing to do with the time in and out per day, here's my solution.

    First create a calculated column.

    Week = WEEKNUM('Table'[date])

    Result:

    Then in a line chart, put Week in X-axis, Name in Legend and date in Y-axis, select Count in Y-axis field. Get the result:

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.