cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rfla
Kudo Kingpin
Kudo Kingpin

IsToday what about IsWeek or IsMonth ?

Hi I know its possible to use this function to check if a date is today :
https://powerapps.microsoft.com/en-us/tutorials/function-now-today-istoday/

 

Is there a similar way to check for current week or month?

Similar to powerquery/bi : 
https://msdn.microsoft.com/en-us/library/mt260715.aspx

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi Rfla,

There is no available function similar to istoday() for week and month, but we could write formula to check.
Take the month as an example, we input the date/time formatted value into a Textinput box, then check if this date is under current month, the formula should be:

If(
And(
Year(DateValue(TextInput.text))=Year(Now()),
Month(DateValue(TextInput.text))=Month(Now())
),
1,
0)


For current week, we need another three functions DateAdd, DateDiff and weekday to help identify:

If(
And(
DateDiff(DateAdd(Now(),-Weekday(Now(),11)),DateValue(Textinput.Text))>0,
DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue(Textinput.Text))<=0
),
1,
0)

See the testing result:

19.PNG

20.PNG

Check to see if this would help.

If you have any further questions, please feel free to post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-micsh-msft
Community Support
Community Support

Hi Rfla,

There is no available function similar to istoday() for week and month, but we could write formula to check.
Take the month as an example, we input the date/time formatted value into a Textinput box, then check if this date is under current month, the formula should be:

If(
And(
Year(DateValue(TextInput.text))=Year(Now()),
Month(DateValue(TextInput.text))=Month(Now())
),
1,
0)


For current week, we need another three functions DateAdd, DateDiff and weekday to help identify:

If(
And(
DateDiff(DateAdd(Now(),-Weekday(Now(),11)),DateValue(Textinput.Text))>0,
DateDiff(DateAdd(Now(),7-Weekday(Now(),11)),DateValue(Textinput.Text))<=0
),
1,
0)

See the testing result:

19.PNG

20.PNG

Check to see if this would help.

If you have any further questions, please feel free to post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,317)