web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formula Help Needed fo...
Power Apps
Unanswered

Formula Help Needed for Calculating Event Status Based on StartDateAndTime and EndDateAndTime"

(0) ShareShare
ReportReport
Posted on by 7

Hi Power Apps Community,

I'm currently working on a Power Apps solution with SharePoint integration, and I need assistance with creating a formula for calculating the status of an event based on its start and end dates. Here are my specific requirements:

  1. The status should be determined as follows:

    • If the current date and time are before the StartDateAndTime, the status is "Upcoming."
    • If the current date and time are between StartDateAndTime and EndDateAndTime, the status is "Ongoing."
    • If the current date and time are after EndDateAndTime, the status is "Completed."
  2. Additionally, if the event has a CancellationStatus of "Approved," the status should be "Cancelled."

I've tried several formulas, but I'm encountering issues, and the status is not updating as expected. 
Second row should be completed but it is not updating.

johnkenshin1234_1-1701691627506.png
Here is my Formula on the Status Column

johnkenshin1234_2-1701691780301.png

 

 

 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @johnkenshin1234 

     

    try this formula:

     

    If(
     CancellationStatus = "Approved", "Cancelled",
     Now() < StartDateAndTime, "Upcoming",
     Now() >= StartDateAndTime && Now() <= EndDateAndTime, "Ongoing",
     Now() > EndDateAndTime, "Completed"
    )

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • johnkenshin1234 Profile Picture
    7 on at

    Upon Entering the Formula it gave me this error message

    johnkenshin1234_0-1701693335443.png

     

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    do you want to directly do it on the sharepoint? If thats the case i guess its not the right forum for it.

  • johnkenshin1234 Profile Picture
    7 on at

    Sorry I thougt it was related for this forum since I have this problem on my gallery  power apps that is related to the Sharepoint

    johnkenshin1234_0-1701693699611.png

    Thank You!

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    did u set any values directly in powerapps on your gallery or are u doing all the filter things directly in the SP settings?

     

    copy the code u have in SP (just to still have it) an delete it. in the gallery select the text control where u want to show the start-end date and put the above formula in the text property

  • johnkenshin1234 Profile Picture
    7 on at

    From I have learned it is filtering the Data On SP
    Still learning about Power apps. if you need any properties I can show it to you.
    The reply that you sugested and copy pasting the code it did not work
    Photo below is the reference I found related on the Status.

    johnkenshin1234_0-1701695637209.png

     


    @mmbr1606 

     

     

    johnkenshin1234_6-1701694621283.png

     

    johnkenshin1234_5-1701694588556.png

     

    johnkenshin1234_0-1701696387224.png

     

     

     

     

     

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard