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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Calculating Total Amou...
Power Pages
Unanswered

Calculating Total Amount in Power pages

(0) ShareShare
ReportReport
Posted on by 4

I am working on a Power Pages  project where I have a " table1" and a " table2". The  table1 contains a "ID" field, and the "table2 "  has a corresponding "ID" field to establish the relationship.

I need to calculate the total amount for a specific "ID" based on the "Amount" field in the " table2". How can I achieve this in Power Pages? Can you provide a formula or guidance on setting up the calculation?

I appreciate any assistance or insights you can provide.

Thank you!

Categories:
I have the same question (0)
  • Alena-Auctus Profile Picture
    15 on at

    Hello @aishwarya31 

    In my recent project, I needed to replicate a similar behavior. In my scenario, I only had 'table 2' containing 'id' and numbers to calculate the sum. To achieve this, I wrote several functions in a JavaScript file corresponding to the respective page.

    My approach involved the following logic:

    1. Function to obtain a token.
    2. Perform AJAX request and retrieve data from Dataverse using the WebApi (WebApi should be avaliable on your web site):
      https://learn.microsoft.com/en-us/power-pages/configure/webapi-how-to
    3. Sort the data and structure it into an object format like {id1: sum, id2: sum, id3: sum}.
    4. Display the processed data in a table.

      Each row in the table(shown in the page) corresponds to an 'id' that matches with the 'id' from Dataverse, making it straightforward to populate the table with data from {id1: sum, id2: sum, id3: sum}".

      As a result, I filled in the last field with the sum (just example):

      AlenaAuctus_0-1706733652889.png

      It might be chalenging when you do it for the first time, so please let me know if you need more detailes or some peices of code.

       

  • Akah Mandela Profile Picture
    445 on at

    One of the ways you can do that is by using Rollup Columns which is a special type of calculated column that automatically aggregates data from related records in another table. It allows you to display summarized information, such as counts, sums, averages, or other calculations, without requiring complex formulas or custom code. 
    You can then display the result in your page.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard