Forum Discussion

lbudack's avatar
lbudack
Advocate III
4 years ago
Solved

Add Week End Dates to Staff Table

I have a staff table that I need to add week end dates to per staff member. I have tried changing relationships to my existing date table and creating new columns, but for some reason, I am not getting the results I want. I feel like I'm missing something easy. 

 

My sample data is below: 

 

Staff Table:

IDNameCategoryAvailable Hours
1000Jane DoeStaff 138.8
1001John DoeStaff 240
1002Mike SmithIntern40
1003John RobertsStaff 338.8
1004Mark JohnsonIntern 227.5

 

Desired Result: 

EMIDNameCategoryAvailable HoursWeek End
1000Jane DoeStaff 138.81/21/2022
1001John DoeStaff 2401/21/2022
1002Mike SmithIntern401/21/2022
1003John RobertsStaff 338.81/21/2022
1004Mark JohnsonIntern 227.51/21/2022
1000Jane DoeStaff 138.81/28/2022
1001John DoeStaff 2401/28/2022
1002Mike SmithIntern401/28/2022
1003John RobertsStaff 338.81/28/2022
1004Mark JohnsonIntern 227.51/28/2022
1000Jane DoeStaff 138.82/4/2022
1001John DoeStaff 2402/4/2022
1002Mike SmithIntern402/4/2022
1003John RobertsStaff 338.82/4/2022
1004Mark JohnsonIntern 227.52/4/2022
1000Jane DoeStaff 138.82/11/2022
1001John DoeStaff 2402/11/2022
1002Mike SmithIntern402/11/2022
1003John RobertsStaff 338.82/11/2022
1004Mark JohnsonIntern 227.52/11/2022
1000Jane DoeStaff 138.82/18/2022
1001John DoeStaff 2402/18/2022
1002Mike SmithIntern402/18/2022
1003John RobertsStaff 338.82/18/2022
1004Mark JohnsonIntern 227.52/18/2022
  • Hi,

     

    to have it in Power query you can:

    - duplicate your date table and filter it to have only WeekEnd (in your case you want Friday)

     

    - then in your table you add a custom column referring the name of the query of your filtered date table

    - expand custom column

    - now expand custom table

    - change type yo date

    and that's done

     

    If this post isuseful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !

     

     

     

2 Replies

  • Hi,

     

    to have it in Power query you can:

    - duplicate your date table and filter it to have only WeekEnd (in your case you want Friday)

     

    - then in your table you add a custom column referring the name of the query of your filtered date table

    - expand custom column

    - now expand custom table

    - change type yo date

    and that's done

     

    If this post isuseful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !

     

     

     

    • lbudack's avatar
      lbudack
      Advocate III

      Thank you! This is exactly it and very straightforward! One of these days I'll be able to logically step through this in my head.