cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

AUTOPOPULATE DATE IN LABEL

Have a label at the top of app using as a header... [ Awards - Week of ]

Need to auto-populate the date for the end of each week.

Any suggestions/Recommendations?

 

Thanks!

5 REPLIES 5
Super User
Super User

You could try the formula listed below. It assumes Sunday is the first day of the week and Saturday is the last day. You can tweak the formula to your use case.

 

"Awards - Week of " & DateAdd(Today(), 7 - Weekday(Today(),StartOfWeek.Sunday), Days)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Memorable Member
Memorable Member

Create a label with this formula

 

If(6-Weekday(Today()-6)=0,Text(Today(),"[$-en-US]dd/mm/yyyy"),Text(Today()+6-Weekday(Today()),"[$-en-US]dd/mm/yyyy"))

 

Where 6 = the day of week number for Friday

Resolver III
Resolver III

Hey @chudson002 

there is currently an idea under review for this: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Addition-of-Week-Number-function-in-Powerapps/i...

 

Also the user mickg posted some code that should work to display the weeknumber:

 

If(RoundDown((Today() - Date(Year(Today()), 1, 1) + (Weekday(Date(Year(Today()), 1, 1) - 1, Monday))) / 7, 0) = 0, 52,RoundDown((Today() - Date(Year(Today()), 1, 1) + (Weekday(Date(Year(Today()), 1, 1) - 1, Monday))) / 7, 0))

 

 

Hope this will help you! 🙂

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

@chudson002 ,

I might as well join the party as I have already done this on a test app and it works fine (using Sunday as End of week)

"Awards for Week ending " & Text(
    Today() + (8 - Weekday(Today())),
    LongDate
)

 Produces 

EoWSunday.png

Hi @chudson002 

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (53,479)