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.
Hi,
I was wondering if there was a way to find the start of each week of dates for multiple years starting from Jan 1 of each year.
So far, I have a calculated column that says:
Solved! Go to Solution.
Do you want to create your week based weekday of the first Jan?
if all weeks should start as on day 1st Jan
Week Start year based = DATEADD('Compare Date'[Compare Date],-1*WEEKDAY('Compare Date'[Compare Date])+weekday(STARTOFYEAR('Compare Date'[Compare Date])),DAY)
if the first week should start on 1st Jan
Week Start Year wise = if(STARTOFYEAR('Compare Date'[Compare Date])>'Compare Date'[Week Start date],STARTOFYEAR('Compare Date'[Compare Date]),'Compare Date'[Week Start date])
All above formula's column not measures
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
I did not get the question completely. But the formula for the start of week and of the week can be
Week Start date = DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY)
Week End date = DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
Is there a way to use this formula so that Week Start Date would calculate for dates starting on Jan 1 for multiple years?
Thank you!
Sarah
Do you want to create your week based weekday of the first Jan?
if all weeks should start as on day 1st Jan
Week Start year based = DATEADD('Compare Date'[Compare Date],-1*WEEKDAY('Compare Date'[Compare Date])+weekday(STARTOFYEAR('Compare Date'[Compare Date])),DAY)
if the first week should start on 1st Jan
Week Start Year wise = if(STARTOFYEAR('Compare Date'[Compare Date])>'Compare Date'[Week Start date],STARTOFYEAR('Compare Date'[Compare Date]),'Compare Date'[Week Start date])
All above formula's column not measures
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
hi @amitchandak ,
is there any way to deal with leap years?
Leap years are throwing off the number of days per week for leap years....
Thank you!
Sarah
Amazing thank you so much!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |