March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I'm trying to creat a column that will contains the date of the previous monday according to my column Date.
For exemple, if i got sunday 15 october 2019 i would like to have monday 9 october 2019
If I have monday 19 october 2022 I would like to keep this date.
I tried to use a DateAdd but it only show the date contains in my column date.
I also try with a weekday, weeknum and year but I don't know how to creat a new date with those informations.
If someone can help me it would be very nice.
Thank you
Solved! Go to Solution.
Hi @Anonymous
You can create a column with below code:-
Last_Monday = CALENDER_TABLE[Date] - WEEKDAY(CALENDER_TABLE[Date],2)+1
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous
You can create a column with below code:-
Last_Monday = CALENDER_TABLE[Date] - WEEKDAY(CALENDER_TABLE[Date],2)+1
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Thank you!
@Anonymous Try something like:
Column =
VAR __Date = [Date]
VAR __MinDate = [Date] - 7
VAR __Calendar = ADDCOLUMNS(CALENDAR(__MinDate, __Date),"__Weekday",WEEKDAY([Date],2))
VAR __MaxMonday = MAXX(FILTER(__Calendar,[__Weekday] = 1),[Date])
RETURN
__MaxMonday
Thank you!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
197 | |
133 | |
107 | |
69 | |
65 |