cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mgodby
Level: Powered On

Is there a way to calculate totals in model-driven apps?

Hello I am trying to get the sub total of a bunch of entities that have a many-to-one relationship with another entity. I was able to get this to work in a canvas app through the use of filtering and Sum() but don't know if it is even possible with model-driven apps. I first thought of using a Flow but then see that there's no way to send data back to a model-driven app the same way I can with a canvas. 

 

model-driven-app.png

 

Is this possible with model-driven apps or should I just stick to canvas?

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Level 10

Re: Is there a way to calculate totals in model-driven apps?

Hi @Mgodby ,

 

If you want to sum the total field from child entity, you can create a Roll-up field to calculate the aggregation.

The rollups are calculated by scheduled system jobs that run asynchronously in the background. The asynchronous job executes once per hour, attempting to recalculate the rollup attribute. In additional to the hourly system job, users may manually force a system recalculation.

Note: You should have write access on parent entity 

Snipaste_2019-11-25_18-02-26.png

Snipaste_2019-11-25_18-10-37.png

Best regards,

Sik

View solution in original post

2 REPLIES 2
Yocomd
Level: Powered On

Re: Is there a way to calculate totals in model-driven apps?

Roll-up fields allow you to sum fields on a one-to-many entity, but those only recalculate every 12 hours, so if you want to see it updated immediately, they're not ideal. (They do have a refresh button attached to the field, which the user can click to force it to recalculate, but you probably don't want to expect the user to do that).

If you can write JavaScript, you could create a Web Resource with a method that pulls in the data, sums it, and fills in the field with the summed value.
v-siky-msft
Level 10

Re: Is there a way to calculate totals in model-driven apps?

Hi @Mgodby ,

 

If you want to sum the total field from child entity, you can create a Roll-up field to calculate the aggregation.

The rollups are calculated by scheduled system jobs that run asynchronously in the background. The asynchronous job executes once per hour, attempting to recalculate the rollup attribute. In additional to the hourly system job, users may manually force a system recalculation.

Note: You should have write access on parent entity 

Snipaste_2019-11-25_18-02-26.png

Snipaste_2019-11-25_18-10-37.png

Best regards,

Sik

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,423)