cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

Calculate previous period from current date

All- I am trying to take todays date and map it to a End Date Column in a table to see if its equal to or less than any of the end dates listed to determine the period I am in. I then want to take the current period and find out what the previous period was. I plan to use the pervious period returned to display a message "You are entering time for Period P1 (dec)."

I have  tired DateDiff also

 

Here is a visual of my table and example of how I want to test result before using them in a message.
AccrualPeriods.PNG

PeriodCalculation.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@Steve0 
Seems like you could use some code like this in the Text property of the label.

"You are entering time for Period " &
LookUp(
    Sort(YourTableName, 'End Date', Descending),
    'End Date' >= DateAdd(Today(), 1 , Months),
    'Period Name'
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
Super User III
Super User III

@Steve0 
Seems like you could use some code like this in the Text property of the label.

"You are entering time for Period " &
LookUp(
    Sort(YourTableName, 'End Date', Descending),
    'End Date' >= DateAdd(Today(), 1 , Months),
    'Period Name'
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

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

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (39,251)