Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Add calculated field in Power App

(0) ShareShare
ReportReport
Posted on by 76

I have a Sharepoint List data source for a Power App. The list is of contractors.  Two of the fields in the list are Start Date and End Date.  In the Power App, I would like to add a calculated field to determine the Status by comparing the Start Date and End Date to Today, e.g.

 

=IF([Start Date] > TODAY, "Inactive",
IF(AND([Start Date] < TODAY, [End Date] > TODAY), "Active",
IF(AND([Start Date] < TODAY, [End Date] < TODAY), "Inactive",
IF(ISBLANK([Start Date]), "Inactive",
"Active"))))

 

But I haven't been able to determine where to add the calculated field in Power Apps.  Can anyone advise?  Thanks!

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Add calculated field in Power App

    @Rajkumar_404 that fixed it!  Thanks so much for all your help!

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: Add calculated field in Power App

    Hi @StaceyGriffeth 

     

    You can modify the formula to check if the 'Start Date' is blank before evaluating its value.

     

    If(
    IsBlank(ThisItem.'Start Date'), "Inactive",
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' > Today(), "Active",
    ThisItem.'Start Date' < Today() && IsBlank(ThisItem.'End Date'), "Active",
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' < Today() && Not(IsBlank(ThisItem.'End Date')), "Inactive",
    ThisItem.'Start Date' > Today(), "Inactive",
    "Active"
    )

     

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Add calculated field in Power App

    Hi @Rajkumar_404  I converted this to be a gallery, added all of my fields, and created the calculated field 'Status'.  It is calculating correctly except where Start Date is blank.  Those items are returning a value of "Active".  Start Date is a 'Date and Time' field in the Sharepoint list.  The formula for the Status calculation is:

     

    If(
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' > Today(), "Active",
    ThisItem.'Start Date' < Today() && IsBlank(ThisItem.'End Date'), "Active",
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' < Today() && Not(IsBlank(ThisItem.'End Date')), "Inactive",
    ThisItem.'Start Date' > Today(), "Inactive",
    IsBlank(ThisItem.'Start Date'), "Inactive",
    "Active"
    )

     

    Do you have any idea why that would not be calculating correctly?

  • Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: Add calculated field in Power App

    This is for only display calculate data in PowerApps. If you want to store displayed data to SharePoint, use the Patch function. To display SharePoint data, use Gallery.

  • StaceyGriffeth Profile Picture
    76 on at
    Re: Add calculated field in Power App

    Thanks for the quick reply, @Rajkumar_404 !  This would be displayed in a data table, and it would calculate for each row in the table.  How do I add a text label or input for each row in the table?  I apologize if this is elementary, I'm very new to Power Apps.

  • Verified answer
    Rajkumar_M Profile Picture
    3,631 Super User 2025 Season 1 on at
    Re: Add calculated field in Power App

    Hi @StaceyGriffeth 

     

    In the Gallery where you're displaying the contractor data, add a Label or Text Input control. This will act as your calculated field to show the status.

     

    Set the Text property of this Label or Text Input control to perform the calculation based on the Start Date and End Date fields from your SharePoint list.

     

    Text(
    If(
    IsBlank(ThisItem.'Start Date'),
    "Inactive",
    If(
    ThisItem.'Start Date' > Today(),
    "Inactive",
    If(
    And(
    ThisItem.'Start Date' < Today(),
    ThisItem.'End Date' > Today()
    ),
    "Active",
    If(
    ThisItem.'End Date' < Today(),
    "Inactive",
    "Active"
    )))
    ))

     

    (Or)

     

    If(
    ThisItem.'Start Date' > Today(), "Inactive",
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' > Today(), "Active",
    ThisItem.'Start Date' < Today() && ThisItem.'End Date' < Today(), "Inactive",
    IsBlank(ThisItem.'Start Date'), "Inactive",
    "Active"
    )

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard