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
lbudack
Advocate III
Advocate III

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
1 ACCEPTED SOLUTION
serpiva64
Super User
Super User

Hi,

serpiva64_0-1644504965679.png

 

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)

serpiva64_2-1644505270007.png

 

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

serpiva64_1-1644505186490.png

- expand custom column

serpiva64_3-1644505432610.png

- now expand custom table

serpiva64_4-1644505486404.png

- 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 !

 

 

 

View solution in original post

2 REPLIES 2
serpiva64
Super User
Super User

Hi,

serpiva64_0-1644504965679.png

 

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)

serpiva64_2-1644505270007.png

 

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

serpiva64_1-1644505186490.png

- expand custom column

serpiva64_3-1644505432610.png

- now expand custom table

serpiva64_4-1644505486404.png

- 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 !

 

 

 

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. 

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.