Forum Discussion
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:
| ID | Name | Category | Available Hours |
| 1000 | Jane Doe | Staff 1 | 38.8 |
| 1001 | John Doe | Staff 2 | 40 |
| 1002 | Mike Smith | Intern | 40 |
| 1003 | John Roberts | Staff 3 | 38.8 |
| 1004 | Mark Johnson | Intern 2 | 27.5 |
Desired Result:
| EMID | Name | Category | Available Hours | Week End |
| 1000 | Jane Doe | Staff 1 | 38.8 | 1/21/2022 |
| 1001 | John Doe | Staff 2 | 40 | 1/21/2022 |
| 1002 | Mike Smith | Intern | 40 | 1/21/2022 |
| 1003 | John Roberts | Staff 3 | 38.8 | 1/21/2022 |
| 1004 | Mark Johnson | Intern 2 | 27.5 | 1/21/2022 |
| 1000 | Jane Doe | Staff 1 | 38.8 | 1/28/2022 |
| 1001 | John Doe | Staff 2 | 40 | 1/28/2022 |
| 1002 | Mike Smith | Intern | 40 | 1/28/2022 |
| 1003 | John Roberts | Staff 3 | 38.8 | 1/28/2022 |
| 1004 | Mark Johnson | Intern 2 | 27.5 | 1/28/2022 |
| 1000 | Jane Doe | Staff 1 | 38.8 | 2/4/2022 |
| 1001 | John Doe | Staff 2 | 40 | 2/4/2022 |
| 1002 | Mike Smith | Intern | 40 | 2/4/2022 |
| 1003 | John Roberts | Staff 3 | 38.8 | 2/4/2022 |
| 1004 | Mark Johnson | Intern 2 | 27.5 | 2/4/2022 |
| 1000 | Jane Doe | Staff 1 | 38.8 | 2/11/2022 |
| 1001 | John Doe | Staff 2 | 40 | 2/11/2022 |
| 1002 | Mike Smith | Intern | 40 | 2/11/2022 |
| 1003 | John Roberts | Staff 3 | 38.8 | 2/11/2022 |
| 1004 | Mark Johnson | Intern 2 | 27.5 | 2/11/2022 |
| 1000 | Jane Doe | Staff 1 | 38.8 | 2/18/2022 |
| 1001 | John Doe | Staff 2 | 40 | 2/18/2022 |
| 1002 | Mike Smith | Intern | 40 | 2/18/2022 |
| 1003 | John Roberts | Staff 3 | 38.8 | 2/18/2022 |
| 1004 | Mark Johnson | Intern 2 | 27.5 | 2/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
- serpiva64Solution Sage
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 !
- lbudackAdvocate 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.