Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
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:
  • Akah Mandela Profile Picture
    445 on at
    Re: Calculating Total Amount in Power pages

    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.

  • Alena-Auctus Profile Picture
    15 on at
    Re: Calculating Total Amount in Power pages

    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.

       

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43