cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dalecombrink
Frequent Visitor

Getting nth Week in a month

I am looking to create a collection similar to a question posed on the PowerBi forum but using Powerapps.

I am looking to see if Today() falls under which week in a month as we need to lock buttons depending on which week of the month it is

dalecombrink_0-1670494728037.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
LaurensM
Memorable Member
Memorable Member

@dalecombrink I didn't find a native function that could solve this.

However, I used the WeekNum() function that retrieves the current week of the year as a number.

With the function below we check the current week value and decrease it with the value of the week before the start of this month:

WeekNum(
    Today(),
    StartOfWeek.Monday
) - (WeekNum(
    Date(
        Year(Today()),
        Month(Today()),
        01
    ),
    StartOfWeek.Monday
) - 1)

 

I hope this helps!

View solution in original post

1 REPLY 1
LaurensM
Memorable Member
Memorable Member

@dalecombrink I didn't find a native function that could solve this.

However, I used the WeekNum() function that retrieves the current week of the year as a number.

With the function below we check the current week value and decrease it with the value of the week before the start of this month:

WeekNum(
    Today(),
    StartOfWeek.Monday
) - (WeekNum(
    Date(
        Year(Today()),
        Month(Today()),
        01
    ),
    StartOfWeek.Monday
) - 1)

 

I hope this helps!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,644)