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 Apps / Use related records in...
Power Apps
Answered

Use related records in calculated column to calculate average score.

(0) ShareShare
ReportReport
Posted on by 124

In my canvas app I have two Dataverse tables Student and Test, one student can attempt many tests so the relationship is one-to-many.

In Test table I have the score column (Decimal number) which contains the score for the test that the student has attempted. Now in the Student table I want to create a calculated column which will contain the average score of the attempted tests by the student.

 

Example

Student A attempts 2 tests

Test 1 - Score 80

Test 2 - Score 90

Student A average score 85

 

Note: Average score must be saved in database.

I have the same question (0)
  • Verified answer
    Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @Usman2 ,

    You can utilize Rollup fields for this purpose as rollup fields can do Avg as one of the calculations...  (I know this references on premises but the details are the same):

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-rollup-fields?view=op-9-1 

     

    Here is a video showing details on rollup columns:  https://youtu.be/ntk57m4A9ko 

     

  • Usman2 Profile Picture
    124 on at

    @dpoggemann 

    Thanks for the solution but now I have one more problem as I thought about it I think that the relationship between Student and Test will be N-to-N will this roll up columns still work. Because in the video the guy says it will not work for N-to-N relation.

  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @Usman2 ,

    No, this will not work with N:N relationships.  My recommendation is to create an intersect entity like the following:

    Student --> Student Test <-- Test

     

    1:N from Student to Student Test

    1:N from Test to Student Test

     

    This way you can store metadata on the Student Test entity (including score) and you will be able to do the rollup on the Student to the Test scores or on the Test to the Student Tests...

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard