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 / If column contains val...
Power Apps
Answered

If column contains value then ignore calculation in power apps

(0) ShareShare
ReportReport
Posted on by 697
Hello,
 
See below Screenshot:
 
 
Amount 1 and Amount 2 are Number format fields. Below is the formula used to calculate the Variance. If Amount 2 is greater than Amount 1, it will return zero. DataCardValue13 is Amount 1 and DataCardValue5 is Amount 2.
If(Value(DataCardValue5.Text) > Value(DataCardValue13.Text),0,Value(DataCardValue13.Text) - Value(DataCardValue5.Text))
There are additional 5 fields into the form. 
 
I'm looking for a logic - where if Amount 2 (DataCardValue5) is blank, Sum the below 5 fields and save the calculated values to Sharepoint
Sum(
DataCardValue36.Text,
DataCardValue37.Text,
DataCardValue38.Text,
DataCardValue39.Text,
DataCardValue40.Text)
We should also allow users to manually enter the value in Amount 2 and save the same records to SharePoint.
 
If Amount 2 has some value, ignore the Sum Calculation else use the Sum Calculation.
 
Please advise. Thanks!
Categories:
I have the same question (0)
  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at
     
    Since I dont see the complete information about how you are saving the data to SharePoint, it will be difficulties to give complete logic, however I will try to help with basic logic:
     
    Use this:
    If(
       IsBlank(DataCardValue5.Text), 
       Set(gblvar_Sum,
    Sum(
    DataCardValue36.Text,
    DataCardValue37.Text,
    DataCardValue38.Text,
    DataCardValue39.Text,
    DataCardValue40.Text));
    .....Logic to Save using gblvar_Sum.....,
    .....Logic to Save without using gblvar_Sum.....
    )
    In above code, first we check whether DataCardValue5 is blank or not, if blank then we declare one global variable named as gblvar_Sum which is nothing but the sum of 5 fields and then sequentially we save the data to SP either using Patch or Submit form using global variable required for the field else save the data to SP using manually enter data.
     
    Please share more on save code, so that I can help further.
     

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.


    Thanks,
    ANB
  • RR-12011342-0 Profile Picture
    25 on at
    Hi,
     
    Try using below code
     
    UpdateContext({
        FinalAmount2: If(
            IsBlank(Value(DataCardValue5.Text)), 
            Sum(
                Value(DataCardValue36.Text),
                Value(DataCardValue37.Text),
                Value(DataCardValue38.Text),
                Value(DataCardValue39.Text),
                Value(DataCardValue40.Text)
            ),
            Value(DataCardValue5.Text)
        )
    });
     
     
    Then PATCH
  • Verified answer
    Prem4253 Profile Picture
    697 on at
     
    I have a Submit button, where OnSelect property is set as below: (FormInspection is the name of the form)
    SubmitForm(FormInspection);
    Notify ("Please make sure all fields are filled in correctly ",NotificationType.Error,3000)
    I tried using your formula for OnChange property for DataCardValue5, but Amount 2 still shows blank
     
     
  • Prem4253 Profile Picture
    697 on at
     
    Tried to apply this formula on Change property but no luck, as the actual amount still shows blank.
     
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard