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

Reverting a date into the first of every single week

Hi, as you can see from the screenshot below, I have a "SCHEDULED_FROM" column, is it possible I could create a new column which only displays the first day (Monday) of that week? i.e. if the date is 27/10/2020, could i convert it to 26/10/2020.

 

 

screenshot 4.png

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

 

New Column = CALCULATE(MAX([SCHEDULED_FROM]),FILTER('Table',WEEKDAY([SCHEDULED_FROM],2)=1 && 'Table'[SCHEDULED_FROM]<=EARLIER([SCHEDULED_FROM])))

 

V-pazhen-msft_0-1611813196781.png

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

 

New Column = CALCULATE(MAX([SCHEDULED_FROM]),FILTER('Table',WEEKDAY([SCHEDULED_FROM],2)=1 && 'Table'[SCHEDULED_FROM]<=EARLIER([SCHEDULED_FROM])))

 

V-pazhen-msft_0-1611813196781.png

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

pranit828
Community Champion
Community Champion

HI @Anonymous 

I would use the below code

'Table'[SCHEDULED_FROM] - WEEKDAY('Table'[SCHEDULED_FROM],2)+1

 pranit828_0-1611671879945.png

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Check out THIS THREAD.

@TomMartens gives a perfect walkthrough for DAX.

 

Alternatively, you can use the Date.StartOfWeek() function in Power Query, where the second argument is where you would specify that Monday was your start-of-week day.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.