cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Level 8

Getting Week Start and End Dates from Week Numer

Hi hi, 

 

I have an app connected to a sharepoint list. 

In the list there is a calculated column to derive the week number from a date. (European dates, thus week starting on Monday)

Here is the formula: 

=INT(([datecolumn]-DATE(YEAR([datecolumn]-WEEKDAY([datecolumn]-1)+4);1;3)+WEEKDAY(DATE(YEAR([datecolumn]-WEEKDAY(datecolumn-1)+4);1;3))+5)/7)

Credit to this site for the formula: Calculated Column Week Number

What I now need in Powerapps, is to get the Start and/or End dates of a week from the week number.

So I have a label and a global variable: varWeekNo

If varWeekNo = 47

Then the label should read: "19-11-2018 - 25-11-2018"

Anyone want to take a stab at this, without using a separate database for all weeknumbers/dates?

Thanks!

3 REPLIES 3
Highlighted
PauwelsSven
Level 8

Re: Getting Week Start and End Dates from Week Numer

Hi,

 

Make 2 more variables?

1 StartWeek: DateColumn - Int(weekday(datecolum))

2 EndWeek: DateColumn + Int(7-weekday(datecolum))

 

Is this an option for you?

 

Regards.

Anonymous
Not applicable

Re: Getting Week Start and End Dates from Week Numer

Hello , 

 I now have the same situation . Did you find a solution ? 

Thank you in advance !

Max10772
Level: Powered On

Re: Getting Week Start and End Dates from Week Numer

Hi SylvieLet17,

 

I had a similar need and I could solve it using folowing formula in PowerApps. For that you wouldn't need week numbers. You can calculate it using your date column directly.

 

For the Start Date (Monday): datecolumn - Weekday(datecolumn, MondayZero)

For the End Date (Sunday): datecolumn + Weekday(datecolumn, Sunday)

 

Label: datecolumn - Weekday(datecolumn, MondayZero) & "-" & datecolumn + Weekday(datecolumn, Sunday)

 

Hope it helps

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 51 members 4,200 guests
Recent signins:
Please welcome our newest community members: