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 / Calculating with a val...
Power Apps
Answered

Calculating with a value operator

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

Currently I am calculating something using this formulas:

 

Set(
 sumTijdTotaal,
 Sum(
 colUrenRegistratie,
 TijdTotaal
 )
);
Set(
 remainder,
 8 - Mod(
 sumTijdTotaal,
 8
 )
);

 


And also this formula: 

 

 Patch(
 UrenRegistratie,
 Defaults(UrenRegistratie),
 EditForm1.Updates,
 {TijdTotaal: Value(EditForm1.Updates.TijdTotaal) - remainder}
 );

 


The first formula basically sums up all of the hours on the Tijdtotaal column in my database. This is a number value. The second one uses the mod function by 8 and gets the remainder of it. So if you have the value 9, the remainder will be 1. 

In the second formula, I just use the patch function to send information to my database. I do Tijdtotaal - the remainder and put that in the tijdtotaal column.

For some reasons this formula works good when only using full numbers. But as soon as I get a number with a comma, it removed the comma and sends it to the database.

So if I have a 6,25 it will write it as 625

What can I do about this?

Categories:
I have the same question (0)
  • troytec Profile Picture
    53 on at

    When I troubleshoot things like that I use a label as the final value I am going to patch to my database. Use a label and set its text to your Tijdtotaal.

     

    To me it sounds like the final outcome isn't coming out as a value but as text perhaps. Maybe try patching this:

    TijdTotaal: Value(EditForm1.Updates.TijdTotaal - remainder)

     

    Always worth giving it a go. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your answer @troytec !

    The formula you provided me does not change anything sadly.

  • troytec Profile Picture
    53 on at

    Create a variable that stores your calculation: totaal - remainder ?

    Then place a label on the screen and set its text property to your calculation. Don't patch anything just yet. We need to see the final outcome.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried to do that, here is the outcome @troytec 

    https://gyazo.com/85a003aa936f185652acbdae0eb82a13

    You can see both values are stated as "Number" but the end result gives "" which is equal to nothing. 

  • troytec Profile Picture
    53 on at

    Hmm, I have never used EditForm1.Updates to get data values. 

     

    Try doing this:

     

    //Set your tijdtotaal

     

     

    Set(
     sumTijdTotaal,
     Sum(
     colUrenRegistratie,
     TijdTotaal
     )
    );

     

     

    //Set your remainder

     

    Set(
     remainder,
     8 - Mod(
     sumTijdTotaal,
     8
     )
    );

     

     

    //Set a new variable for your calculation

    Set(varTijdTotaal, 'Insert your calculation here');

     

    Then your patch becomes:

     Patch(
     UrenRegistratie,
     Defaults(UrenRegistratie),
     EditForm1.Updates,
     {TijdTotaal: varTijdTotaal}
     );
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Fixed it by putting some values to single line text instead of number

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 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard