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
Anonymous
Not applicable

How to Group Dates to create a 'Week Start' column

Hello,

 

I'm trying to create a column in my calendar that says 'Week Start'. Essentially what I want it to say is 'If the day of the week is Monday, then take that date and copy it down till the next Monday'. And then when it gets to next Monday, take that new date and copy it down. Please let me know how I can do this in Power BI! Thanks!

 

Example:

Day of week     Date                           Week Start

M                      Dec 26 2022              Dec 26 2022

T                        Dec 27 2022              Dec 26 2022

W                     Dec 28 2022               Dec 26 2022

T                       Dec 29 2022              Dec 26 2022

F                       Dec 30 2022               Dec 26 2022

S                       Dec 31 2022              Dec 26 2022

S                       Jan 1 2022                 Dec 26 2022

M                     Jan 2 2022                  Jan 2 2022

T                       Jan 3 2022                  Jan 2 2022

 

 

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

Hi @Anonymous ,

Go to Power Query, Add Column tab, Conditional Column. Then day of week12.PNG

you will get this.

day of week.PNG

 

 


then go to the Transform tab, select your new column, select Fill, select down.
day of week1.PNG

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Just use a calculated column that tells you the Monday of the date in question

 

 Date.StartOfWeek([Date], Day.Monday)

Nathaniel_C
Super User
Super User

Hi @Anonymous ,

Go to Power Query, Add Column tab, Conditional Column. Then day of week12.PNG

you will get this.

day of week.PNG

 

 


then go to the Transform tab, select your new column, select Fill, select down.
day of week1.PNG

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thank you! I had it up until the Conditional Column part but wasn't aware of the Fill Down function. This solves my problem!

Hi @Anonymous ,

You may want to look at the book M is for (Data) Monkey by @KenPuls . It has lots of great knowledge on Power Query.

Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

Top Solution Authors
Top Kudoed Authors